#include <glk/colormap.hpp>

#include <vector>
#include <iostream>

namespace glk{

const std::array<std::array<unsigned char, 3>, 256> turbo_bytes = {
    {{48, 18, 59},   {50, 21, 67},   {51, 24, 74},   {52, 27, 81},   {53, 30, 88},   {54, 33, 95},    {55, 36, 102},   {56, 39, 109},  {57, 42, 115},  {58, 45, 121},  {59, 47, 128},  {60, 50, 134},  {61, 53, 139},  {62, 56, 145},  {63, 59, 151},
     {63, 62, 156},  {64, 64, 162},  {65, 67, 167},  {65, 70, 172},  {66, 73, 177},  {66, 75, 181},   {67, 78, 186},   {68, 81, 191},  {68, 84, 195},  {68, 86, 199},  {69, 89, 203},  {69, 92, 207},  {69, 94, 211},  {70, 97, 214},  {70, 100, 218},
     {70, 102, 221}, {70, 105, 224}, {70, 107, 227}, {71, 110, 230}, {71, 113, 233}, {71, 115, 235},  {71, 118, 238},  {71, 120, 240}, {71, 123, 242}, {70, 125, 244}, {70, 128, 246}, {70, 130, 248}, {70, 133, 250}, {70, 135, 251}, {69, 138, 252},
     {69, 140, 253}, {68, 143, 254}, {67, 145, 254}, {66, 148, 255}, {65, 150, 255}, {64, 153, 255},  {62, 155, 254},  {61, 158, 254}, {59, 160, 253}, {58, 163, 252}, {56, 165, 251}, {55, 168, 250}, {53, 171, 248}, {51, 173, 247}, {49, 175, 245},
     {47, 178, 244}, {46, 180, 242}, {44, 183, 240}, {42, 185, 238}, {40, 188, 235}, {39, 190, 233},  {37, 192, 231},  {35, 195, 228}, {34, 197, 226}, {32, 199, 223}, {31, 201, 221}, {30, 203, 218}, {28, 205, 216}, {27, 208, 213}, {26, 210, 210},
     {26, 212, 208}, {25, 213, 205}, {24, 215, 202}, {24, 217, 200}, {24, 219, 197}, {24, 221, 194},  {24, 222, 192},  {24, 224, 189}, {25, 226, 187}, {25, 227, 185}, {26, 228, 182}, {28, 230, 180}, {29, 231, 178}, {31, 233, 175}, {32, 234, 172},
     {34, 235, 170}, {37, 236, 167}, {39, 238, 164}, {42, 239, 161}, {44, 240, 158}, {47, 241, 155},  {50, 242, 152},  {53, 243, 148}, {56, 244, 145}, {60, 245, 142}, {63, 246, 138}, {67, 247, 135}, {70, 248, 132}, {74, 248, 128}, {78, 249, 125},
     {82, 250, 122}, {85, 250, 118}, {89, 251, 115}, {93, 252, 111}, {97, 252, 108}, {101, 253, 105}, {105, 253, 102}, {109, 254, 98}, {113, 254, 95}, {117, 254, 92}, {121, 254, 89}, {125, 255, 86}, {128, 255, 83}, {132, 255, 81}, {136, 255, 78},
     {139, 255, 75}, {143, 255, 73}, {146, 255, 71}, {150, 254, 68}, {153, 254, 66}, {156, 254, 64},  {159, 253, 63},  {161, 253, 61}, {164, 252, 60}, {167, 252, 58}, {169, 251, 57}, {172, 251, 56}, {175, 250, 55}, {177, 249, 54}, {180, 248, 54},
     {183, 247, 53}, {185, 246, 53}, {188, 245, 52}, {190, 244, 52}, {193, 243, 52}, {195, 241, 52},  {198, 240, 52},  {200, 239, 52}, {203, 237, 52}, {205, 236, 52}, {208, 234, 52}, {210, 233, 53}, {212, 231, 53}, {215, 229, 53}, {217, 228, 54},
     {219, 226, 54}, {221, 224, 55}, {223, 223, 55}, {225, 221, 55}, {227, 219, 56}, {229, 217, 56},  {231, 215, 57},  {233, 213, 57}, {235, 211, 57}, {236, 209, 58}, {238, 207, 58}, {239, 205, 58}, {241, 203, 58}, {242, 201, 58}, {244, 199, 58},
     {245, 197, 58}, {246, 195, 58}, {247, 193, 58}, {248, 190, 57}, {249, 188, 57}, {250, 186, 57},  {251, 184, 56},  {251, 182, 55}, {252, 179, 54}, {252, 177, 54}, {253, 174, 53}, {253, 172, 52}, {254, 169, 51}, {254, 167, 50}, {254, 164, 49},
     {254, 161, 48}, {254, 158, 47}, {254, 155, 45}, {254, 153, 44}, {254, 150, 43}, {254, 147, 42},  {254, 144, 41},  {253, 141, 39}, {253, 138, 38}, {252, 135, 37}, {252, 132, 35}, {251, 129, 34}, {251, 126, 33}, {250, 123, 31}, {249, 120, 30},
     {249, 117, 29}, {248, 114, 28}, {247, 111, 26}, {246, 108, 25}, {245, 105, 24}, {244, 102, 23},  {243, 99, 21},   {242, 96, 20},  {241, 93, 19},  {240, 91, 18},  {239, 88, 17},  {237, 85, 16},  {236, 83, 15},  {235, 80, 14},  {234, 78, 13},
     {232, 75, 12},  {231, 73, 12},  {229, 71, 11},  {228, 69, 10},  {226, 67, 10},  {225, 65, 9},    {223, 63, 8},    {221, 61, 8},   {220, 59, 7},   {218, 57, 7},   {216, 55, 6},   {214, 53, 6},   {212, 51, 5},   {210, 49, 5},   {208, 47, 5},
     {206, 45, 4},   {204, 43, 4},   {202, 42, 4},   {200, 40, 3},   {197, 38, 3},   {195, 37, 3},    {193, 35, 2},    {190, 33, 2},   {188, 32, 2},   {185, 30, 2},   {183, 29, 2},   {180, 27, 1},   {178, 26, 1},   {175, 24, 1},   {172, 23, 1},
     {169, 22, 1},   {167, 20, 1},   {164, 19, 1},   {161, 18, 1},   {158, 16, 1},   {155, 15, 1},    {152, 14, 1},    {149, 13, 1},   {146, 11, 1},   {142, 10, 1},   {139, 9, 2},    {136, 8, 2},    {133, 7, 2},    {129, 6, 2},    {126, 5, 2},
     {122, 4, 3}}};

const std::array<std::array<unsigned char, 3>, 256> jet_bytes = {
    {{0, 0, 127},     {0, 0, 131},     {0, 0, 135},     {0, 0, 139},     {0, 0, 143},     {0, 0, 147},     {0, 0, 151},     {0, 0, 155},     {0, 0, 159},     {0, 0, 163},     {0, 0, 167},     {0, 0, 171},     {0, 0, 175},     {0, 0, 179},
     {0, 0, 183},     {0, 0, 187},     {0, 0, 191},     {0, 0, 195},     {0, 0, 199},     {0, 0, 203},     {0, 0, 207},     {0, 0, 211},     {0, 0, 215},     {0, 0, 219},     {0, 0, 223},     {0, 0, 227},     {0, 0, 231},     {0, 0, 235},
     {0, 0, 239},     {0, 0, 243},     {0, 0, 247},     {0, 0, 251},     {0, 0, 255},     {0, 4, 255},     {0, 8, 255},     {0, 12, 255},    {0, 16, 255},    {0, 20, 255},    {0, 24, 255},    {0, 28, 255},    {0, 32, 255},    {0, 36, 255},
     {0, 40, 255},    {0, 44, 255},    {0, 48, 255},    {0, 52, 255},    {0, 56, 255},    {0, 60, 255},    {0, 64, 255},    {0, 68, 255},    {0, 72, 255},    {0, 76, 255},    {0, 80, 255},    {0, 84, 255},    {0, 88, 255},    {0, 92, 255},
     {0, 96, 255},    {0, 100, 255},   {0, 104, 255},   {0, 108, 255},   {0, 112, 255},   {0, 116, 255},   {0, 120, 255},   {0, 124, 255},   {0, 128, 255},   {0, 132, 255},   {0, 136, 255},   {0, 140, 255},   {0, 144, 255},   {0, 148, 255},
     {0, 152, 255},   {0, 156, 255},   {0, 160, 255},   {0, 164, 255},   {0, 168, 255},   {0, 172, 255},   {0, 176, 255},   {0, 180, 255},   {0, 184, 255},   {0, 188, 255},   {0, 192, 255},   {0, 196, 255},   {0, 200, 255},   {0, 204, 255},
     {0, 208, 255},   {0, 212, 255},   {0, 216, 255},   {0, 220, 255},   {0, 224, 255},   {0, 228, 255},   {0, 232, 255},   {0, 236, 255},   {0, 240, 255},   {0, 244, 255},   {0, 248, 255},   {0, 252, 255},   {1, 255, 253},   {5, 255, 249},
     {9, 255, 245},   {13, 255, 241},  {17, 255, 237},  {21, 255, 233},  {25, 255, 229},  {29, 255, 225},  {33, 255, 221},  {37, 255, 217},  {41, 255, 213},  {45, 255, 209},  {49, 255, 205},  {53, 255, 201},  {57, 255, 197},  {61, 255, 193},
     {65, 255, 189},  {69, 255, 185},  {73, 255, 181},  {77, 255, 177},  {81, 255, 173},  {85, 255, 169},  {89, 255, 165},  {93, 255, 161},  {97, 255, 157},  {101, 255, 153}, {105, 255, 149}, {109, 255, 145}, {113, 255, 141}, {117, 255, 137},
     {121, 255, 133}, {125, 255, 129}, {129, 255, 125}, {133, 255, 121}, {137, 255, 117}, {141, 255, 113}, {145, 255, 109}, {149, 255, 105}, {153, 255, 101}, {157, 255, 97},  {161, 255, 93},  {165, 255, 89},  {169, 255, 85},  {173, 255, 81},
     {177, 255, 77},  {181, 255, 73},  {185, 255, 69},  {189, 255, 65},  {193, 255, 61},  {197, 255, 57},  {201, 255, 53},  {205, 255, 49},  {209, 255, 45},  {213, 255, 41},  {217, 255, 37},  {221, 255, 33},  {225, 255, 29},  {229, 255, 25},
     {233, 255, 21},  {237, 255, 17},  {241, 255, 13},  {245, 255, 9},   {249, 255, 5},   {253, 255, 1},   {255, 252, 0},   {255, 248, 0},   {255, 244, 0},   {255, 240, 0},   {255, 236, 0},   {255, 232, 0},   {255, 228, 0},   {255, 224, 0},
     {255, 220, 0},   {255, 216, 0},   {255, 212, 0},   {255, 208, 0},   {255, 204, 0},   {255, 200, 0},   {255, 196, 0},   {255, 192, 0},   {255, 188, 0},   {255, 184, 0},   {255, 180, 0},   {255, 176, 0},   {255, 172, 0},   {255, 168, 0},
     {255, 164, 0},   {255, 160, 0},   {255, 156, 0},   {255, 152, 0},   {255, 148, 0},   {255, 144, 0},   {255, 140, 0},   {255, 136, 0},   {255, 132, 0},   {255, 128, 0},   {255, 124, 0},   {255, 120, 0},   {255, 116, 0},   {255, 112, 0},
     {255, 108, 0},   {255, 104, 0},   {255, 100, 0},   {255, 96, 0},    {255, 92, 0},    {255, 88, 0},    {255, 84, 0},    {255, 80, 0},    {255, 76, 0},    {255, 72, 0},    {255, 68, 0},    {255, 64, 0},    {255, 60, 0},    {255, 56, 0},
     {255, 52, 0},    {255, 48, 0},    {255, 44, 0},    {255, 40, 0},    {255, 36, 0},    {255, 32, 0},    {255, 28, 0},    {255, 24, 0},    {255, 20, 0},    {255, 16, 0},    {255, 12, 0},    {255, 8, 0},     {255, 4, 0},     {255, 0, 0},
     {251, 0, 0},     {247, 0, 0},     {243, 0, 0},     {239, 0, 0},     {235, 0, 0},     {231, 0, 0},     {227, 0, 0},     {223, 0, 0},     {219, 0, 0},     {215, 0, 0},     {211, 0, 0},     {207, 0, 0},     {203, 0, 0},     {199, 0, 0},
     {195, 0, 0},     {191, 0, 0},     {187, 0, 0},     {183, 0, 0},     {179, 0, 0},     {175, 0, 0},     {171, 0, 0},     {167, 0, 0},     {163, 0, 0},     {159, 0, 0},     {155, 0, 0},     {151, 0, 0},     {147, 0, 0},     {143, 0, 0},
     {139, 0, 0},     {135, 0, 0},     {131, 0, 0},     {127, 0, 0}}};

const std::array<std::array<unsigned char, 3>, 256> cividis_bytes = {
    {{0, 32, 76},     {0, 32, 78},     {0, 33, 80},     {0, 34, 81},     {0, 35, 83},     {0, 35, 85},     {0, 36, 86},     {0, 37, 88},     {0, 38, 90},     {0, 38, 91},     {0, 39, 93},     {0, 40, 95},     {0, 40, 97},     {0, 41, 99},
     {0, 42, 100},    {0, 42, 102},    {0, 43, 104},    {0, 44, 106},    {0, 45, 108},    {0, 45, 109},    {0, 46, 110},    {0, 46, 111},    {0, 47, 111},    {0, 47, 111},    {0, 48, 111},    {0, 49, 111},    {0, 49, 111},    {0, 50, 110},
     {0, 51, 110},    {0, 52, 110},    {0, 52, 110},    {1, 53, 110},    {6, 54, 110},    {10, 55, 109},   {14, 55, 109},   {18, 56, 109},   {21, 57, 109},   {23, 57, 109},   {26, 58, 108},   {28, 59, 108},   {30, 60, 108},   {32, 60, 108},
     {34, 61, 108},   {36, 62, 108},   {38, 62, 108},   {39, 63, 108},   {41, 64, 107},   {43, 65, 107},   {44, 65, 107},   {46, 66, 107},   {47, 67, 107},   {49, 68, 107},   {50, 68, 107},   {51, 69, 107},   {53, 70, 107},   {54, 70, 107},
     {55, 71, 107},   {56, 72, 107},   {58, 73, 107},   {59, 73, 107},   {60, 74, 107},   {61, 75, 107},   {62, 75, 107},   {64, 76, 107},   {65, 77, 107},   {66, 78, 107},   {67, 78, 107},   {68, 79, 107},   {69, 80, 107},   {70, 80, 107},
     {71, 81, 107},   {72, 82, 107},   {73, 83, 107},   {74, 83, 107},   {75, 84, 107},   {76, 85, 107},   {77, 85, 107},   {78, 86, 107},   {79, 87, 108},   {80, 88, 108},   {81, 88, 108},   {82, 89, 108},   {83, 90, 108},   {84, 90, 108},
     {85, 91, 108},   {86, 92, 108},   {87, 93, 109},   {88, 93, 109},   {89, 94, 109},   {90, 95, 109},   {91, 95, 109},   {92, 96, 109},   {93, 97, 110},   {94, 98, 110},   {95, 98, 110},   {95, 99, 110},   {96, 100, 110},  {97, 101, 111},
     {98, 101, 111},  {99, 102, 111},  {100, 103, 111}, {101, 103, 111}, {102, 104, 112}, {103, 105, 112}, {104, 106, 112}, {104, 106, 112}, {105, 107, 113}, {106, 108, 113}, {107, 109, 113}, {108, 109, 114}, {109, 110, 114}, {110, 111, 114},
     {111, 111, 114}, {111, 112, 115}, {112, 113, 115}, {113, 114, 115}, {114, 114, 116}, {115, 115, 116}, {116, 116, 117}, {117, 117, 117}, {117, 117, 117}, {118, 118, 118}, {119, 119, 118}, {120, 120, 118}, {121, 120, 119}, {122, 121, 119},
     {123, 122, 119}, {123, 123, 120}, {124, 123, 120}, {125, 124, 120}, {126, 125, 120}, {127, 126, 120}, {128, 126, 120}, {129, 127, 120}, {130, 128, 120}, {131, 129, 120}, {132, 129, 120}, {133, 130, 120}, {134, 131, 120}, {135, 132, 120},
     {136, 133, 120}, {137, 133, 120}, {138, 134, 120}, {139, 135, 120}, {140, 136, 120}, {141, 136, 120}, {142, 137, 120}, {143, 138, 120}, {144, 139, 120}, {145, 140, 120}, {146, 140, 120}, {147, 141, 120}, {148, 142, 120}, {149, 143, 120},
     {150, 143, 119}, {151, 144, 119}, {152, 145, 119}, {153, 146, 119}, {154, 147, 119}, {155, 147, 119}, {156, 148, 119}, {157, 149, 119}, {158, 150, 118}, {159, 151, 118}, {160, 152, 118}, {161, 152, 118}, {162, 153, 118}, {163, 154, 117},
     {164, 155, 117}, {165, 156, 117}, {166, 156, 117}, {167, 157, 117}, {168, 158, 116}, {169, 159, 116}, {170, 160, 116}, {171, 161, 116}, {172, 161, 115}, {173, 162, 115}, {174, 163, 115}, {175, 164, 115}, {176, 165, 114}, {177, 166, 114},
     {178, 166, 114}, {180, 167, 113}, {181, 168, 113}, {182, 169, 113}, {183, 170, 112}, {184, 171, 112}, {185, 171, 112}, {186, 172, 111}, {187, 173, 111}, {188, 174, 110}, {189, 175, 110}, {190, 176, 110}, {191, 177, 109}, {192, 177, 109},
     {193, 178, 108}, {194, 179, 108}, {195, 180, 108}, {197, 181, 107}, {198, 182, 107}, {199, 183, 106}, {200, 184, 106}, {201, 184, 105}, {202, 185, 105}, {203, 186, 104}, {204, 187, 104}, {205, 188, 103}, {206, 189, 103}, {208, 190, 102},
     {209, 191, 102}, {210, 192, 101}, {211, 192, 101}, {212, 193, 100}, {213, 194, 99},  {214, 195, 99},  {215, 196, 98},  {216, 197, 97},  {217, 198, 97},  {219, 199, 96},  {220, 200, 96},  {221, 201, 95},  {222, 202, 94},  {223, 203, 93},
     {224, 203, 93},  {225, 204, 92},  {227, 205, 91},  {228, 206, 91},  {229, 207, 90},  {230, 208, 89},  {231, 209, 88},  {232, 210, 87},  {233, 211, 86},  {235, 212, 86},  {236, 213, 85},  {237, 214, 84},  {238, 215, 83},  {239, 216, 82},
     {240, 217, 81},  {241, 218, 80},  {243, 219, 79},  {244, 220, 78},  {245, 221, 77},  {246, 222, 76},  {247, 223, 75},  {249, 224, 73},  {250, 224, 72},  {251, 225, 71},  {252, 226, 70},  {253, 227, 69},  {255, 228, 67},  {255, 229, 66},
     {255, 230, 66},  {255, 231, 67},  {255, 232, 68},  {255, 233, 69}}};

const std::array<std::array<unsigned char, 3>, 256> ocean_bytes = {
    {{253, 254, 204}, {251, 253, 203}, {249, 252, 202}, {247, 251, 200}, {245, 250, 199}, {243, 250, 198}, {241, 249, 197}, {239, 248, 196}, {237, 247, 195}, {235, 247, 193}, {233, 246, 192}, {231, 245, 191}, {229, 244, 190}, {227, 244, 189},
     {225, 243, 188}, {223, 242, 187}, {221, 242, 186}, {219, 241, 185}, {217, 240, 184}, {215, 239, 183}, {212, 239, 182}, {210, 238, 181}, {208, 237, 180}, {206, 236, 179}, {204, 236, 179}, {202, 235, 178}, {200, 234, 177}, {198, 234, 176},
     {196, 233, 175}, {193, 232, 175}, {191, 231, 174}, {189, 231, 173}, {187, 230, 172}, {185, 229, 172}, {183, 229, 171}, {181, 228, 170}, {178, 227, 170}, {176, 226, 169}, {174, 226, 169}, {172, 225, 168}, {170, 224, 168}, {167, 224, 167},
     {165, 223, 167}, {163, 222, 166}, {161, 221, 166}, {159, 221, 165}, {156, 220, 165}, {154, 219, 165}, {152, 218, 164}, {150, 218, 164}, {148, 217, 164}, {146, 216, 164}, {144, 215, 164}, {141, 215, 163}, {139, 214, 163}, {137, 213, 163},
     {135, 212, 163}, {133, 211, 163}, {131, 211, 163}, {129, 210, 163}, {127, 209, 163}, {125, 208, 163}, {124, 207, 163}, {122, 206, 163}, {120, 206, 163}, {118, 205, 163}, {117, 204, 163}, {115, 203, 163}, {113, 202, 163}, {112, 201, 163},
     {110, 200, 163}, {109, 199, 163}, {107, 198, 163}, {106, 197, 164}, {105, 196, 164}, {103, 195, 164}, {102, 194, 164}, {101, 194, 164}, {100, 193, 164}, {99, 192, 164},  {98, 191, 164},  {97, 190, 164},  {96, 189, 164},  {95, 188, 164},
     {94, 187, 164},  {93, 186, 164},  {92, 185, 164},  {91, 184, 164},  {90, 183, 164},  {90, 182, 164},  {89, 180, 164},  {88, 179, 164},  {88, 178, 164},  {87, 177, 164},  {86, 176, 164},  {86, 175, 164},  {85, 174, 163},  {85, 173, 163},
     {84, 172, 163},  {83, 171, 163},  {83, 170, 163},  {82, 169, 163},  {82, 168, 163},  {81, 167, 163},  {81, 166, 162},  {81, 165, 162},  {80, 164, 162},  {80, 163, 162},  {79, 162, 162},  {79, 161, 162},  {79, 160, 162},  {78, 159, 161},
     {78, 158, 161},  {77, 157, 161},  {77, 156, 161},  {77, 155, 161},  {76, 154, 160},  {76, 153, 160},  {75, 152, 160},  {75, 151, 160},  {75, 150, 160},  {74, 149, 159},  {74, 148, 159},  {74, 147, 159},  {73, 146, 159},  {73, 145, 158},
     {73, 144, 158},  {72, 143, 158},  {72, 142, 158},  {72, 141, 157},  {71, 140, 157},  {71, 139, 157},  {71, 138, 157},  {70, 137, 157},  {70, 136, 156},  {70, 135, 156},  {69, 134, 156},  {69, 133, 156},  {69, 132, 155},  {68, 131, 155},
     {68, 130, 155},  {68, 129, 155},  {68, 128, 155},  {67, 127, 154},  {67, 126, 154},  {67, 125, 154},  {66, 124, 154},  {66, 123, 153},  {66, 122, 153},  {66, 121, 153},  {65, 120, 153},  {65, 119, 153},  {65, 118, 152},  {64, 117, 152},
     {64, 116, 152},  {64, 115, 152},  {64, 114, 152},  {64, 113, 151},  {63, 112, 151},  {63, 111, 151},  {63, 110, 151},  {63, 109, 151},  {63, 108, 150},  {62, 107, 150},  {62, 106, 150},  {62, 105, 150},  {62, 104, 150},  {62, 103, 149},
     {62, 102, 149},  {62, 101, 149},  {62, 100, 149},  {62, 99, 148},   {62, 98, 148},   {62, 97, 148},   {62, 96, 148},   {62, 95, 147},   {62, 94, 147},   {62, 92, 147},   {62, 91, 147},   {62, 90, 146},   {62, 89, 146},   {62, 88, 146},
     {62, 87, 145},   {62, 86, 145},   {63, 85, 144},   {63, 84, 144},   {63, 83, 143},   {63, 82, 143},   {63, 80, 142},   {64, 79, 141},   {64, 78, 141},   {64, 77, 140},   {64, 76, 139},   {65, 75, 138},   {65, 74, 137},   {65, 73, 136},
     {65, 72, 135},   {65, 71, 133},   {65, 70, 132},   {65, 69, 131},   {65, 68, 129},   {66, 67, 128},   {65, 66, 126},   {65, 65, 125},   {65, 64, 123},   {65, 64, 122},   {65, 63, 120},   {65, 62, 118},   {65, 61, 117},   {64, 60, 115},
     {64, 60, 113},   {64, 59, 112},   {64, 58, 110},   {63, 57, 108},   {63, 56, 107},   {63, 56, 105},   {62, 55, 103},   {62, 54, 102},   {61, 53, 100},   {61, 53, 98},    {61, 52, 97},    {60, 51, 95},    {60, 50, 93},    {59, 50, 92},
     {59, 49, 90},    {58, 48, 88},    {58, 48, 87},    {57, 47, 85},    {57, 46, 84},    {56, 45, 82},    {56, 45, 81},    {55, 44, 79},    {54, 43, 77},    {54, 42, 76},    {53, 42, 74},    {53, 41, 73},    {52, 40, 71},    {52, 40, 70},
     {51, 39, 68},    {50, 38, 67},    {50, 37, 65},    {49, 37, 64},    {48, 36, 62},    {48, 35, 61},    {47, 34, 59},    {47, 34, 58},    {46, 33, 57},    {45, 32, 55},    {45, 31, 54},    {44, 31, 52},    {43, 30, 51},    {43, 29, 50},
     {42, 28, 48},    {41, 28, 47},    {40, 27, 45},    {40, 26, 44}}};

const std::array<std::array<unsigned char, 3>, 256> autumn_bytes = {
    {{255, 1, 0},   {255, 1, 0},   {255, 2, 0},   {255, 3, 0},   {255, 4, 0},   {255, 5, 0},   {255, 6, 0},   {255, 7, 0},   {255, 8, 0},   {255, 9, 0},   {255, 10, 0},  {255, 11, 0},  {255, 12, 0},  {255, 13, 0},  {255, 14, 0},  {255, 15, 0},
     {255, 16, 0},  {255, 17, 0},  {255, 17, 0},  {255, 19, 0},  {255, 20, 0},  {255, 21, 0},  {255, 21, 0},  {255, 23, 0},  {255, 24, 0},  {255, 25, 0},  {255, 25, 0},  {255, 27, 0},  {255, 28, 0},  {255, 29, 0},  {255, 29, 0},  {255, 31, 0},
     {255, 32, 0},  {255, 33, 0},  {255, 34, 0},  {255, 35, 0},  {255, 35, 0},  {255, 37, 0},  {255, 38, 0},  {255, 39, 0},  {255, 40, 0},  {255, 41, 0},  {255, 42, 0},  {255, 43, 0},  {255, 43, 0},  {255, 45, 0},  {255, 46, 0},  {255, 47, 0},
     {255, 48, 0},  {255, 49, 0},  {255, 50, 0},  {255, 51, 0},  {255, 51, 0},  {255, 53, 0},  {255, 54, 0},  {255, 55, 0},  {255, 56, 0},  {255, 57, 0},  {255, 58, 0},  {255, 59, 0},  {255, 59, 0},  {255, 61, 0},  {255, 62, 0},  {255, 63, 0},
     {255, 64, 0},  {255, 65, 0},  {255, 66, 0},  {255, 67, 0},  {255, 68, 0},  {255, 69, 0},  {255, 70, 0},  {255, 71, 0},  {255, 72, 0},  {255, 73, 0},  {255, 73, 0},  {255, 75, 0},  {255, 76, 0},  {255, 77, 0},  {255, 78, 0},  {255, 79, 0},
     {255, 80, 0},  {255, 81, 0},  {255, 82, 0},  {255, 83, 0},  {255, 84, 0},  {255, 85, 0},  {255, 86, 0},  {255, 87, 0},  {255, 88, 0},  {255, 89, 0},  {255, 89, 0},  {255, 90, 0},  {255, 92, 0},  {255, 93, 0},  {255, 94, 0},  {255, 95, 0},
     {255, 96, 0},  {255, 97, 0},  {255, 98, 0},  {255, 99, 0},  {255, 100, 0}, {255, 101, 0}, {255, 102, 0}, {255, 103, 0}, {255, 104, 0}, {255, 105, 0}, {255, 105, 0}, {255, 106, 0}, {255, 108, 0}, {255, 109, 0}, {255, 110, 0}, {255, 111, 0},
     {255, 112, 0}, {255, 113, 0}, {255, 114, 0}, {255, 115, 0}, {255, 116, 0}, {255, 117, 0}, {255, 118, 0}, {255, 119, 0}, {255, 120, 0}, {255, 121, 0}, {255, 121, 0}, {255, 122, 0}, {255, 124, 0}, {255, 125, 0}, {255, 126, 0}, {255, 127, 0},
     {255, 128, 0}, {255, 129, 0}, {255, 130, 0}, {255, 131, 0}, {255, 132, 0}, {255, 133, 0}, {255, 134, 0}, {255, 135, 0}, {255, 136, 0}, {255, 137, 0}, {255, 138, 0}, {255, 139, 0}, {255, 140, 0}, {255, 141, 0}, {255, 142, 0}, {255, 143, 0},
     {255, 144, 0}, {255, 145, 0}, {255, 146, 0}, {255, 147, 0}, {255, 148, 0}, {255, 149, 0}, {255, 149, 0}, {255, 150, 0}, {255, 152, 0}, {255, 153, 0}, {255, 154, 0}, {255, 155, 0}, {255, 156, 0}, {255, 157, 0}, {255, 158, 0}, {255, 159, 0},
     {255, 160, 0}, {255, 161, 0}, {255, 162, 0}, {255, 163, 0}, {255, 164, 0}, {255, 165, 0}, {255, 166, 0}, {255, 167, 0}, {255, 168, 0}, {255, 169, 0}, {255, 170, 0}, {255, 171, 0}, {255, 172, 0}, {255, 173, 0}, {255, 174, 0}, {255, 175, 0},
     {255, 176, 0}, {255, 177, 0}, {255, 178, 0}, {255, 179, 0}, {255, 180, 0}, {255, 181, 0}, {255, 181, 0}, {255, 182, 0}, {255, 183, 0}, {255, 185, 0}, {255, 186, 0}, {255, 187, 0}, {255, 188, 0}, {255, 189, 0}, {255, 190, 0}, {255, 191, 0},
     {255, 192, 0}, {255, 193, 0}, {255, 194, 0}, {255, 195, 0}, {255, 196, 0}, {255, 197, 0}, {255, 198, 0}, {255, 199, 0}, {255, 200, 0}, {255, 201, 0}, {255, 202, 0}, {255, 203, 0}, {255, 204, 0}, {255, 205, 0}, {255, 206, 0}, {255, 207, 0},
     {255, 208, 0}, {255, 209, 0}, {255, 210, 0}, {255, 211, 0}, {255, 212, 0}, {255, 213, 0}, {255, 213, 0}, {255, 214, 0}, {255, 215, 0}, {255, 217, 0}, {255, 218, 0}, {255, 219, 0}, {255, 220, 0}, {255, 221, 0}, {255, 222, 0}, {255, 223, 0},
     {255, 224, 0}, {255, 225, 0}, {255, 226, 0}, {255, 227, 0}, {255, 228, 0}, {255, 229, 0}, {255, 230, 0}, {255, 231, 0}, {255, 232, 0}, {255, 233, 0}, {255, 234, 0}, {255, 235, 0}, {255, 236, 0}, {255, 237, 0}, {255, 238, 0}, {255, 239, 0},
     {255, 240, 0}, {255, 241, 0}, {255, 242, 0}, {255, 243, 0}, {255, 244, 0}, {255, 245, 0}, {255, 245, 0}, {255, 246, 0}, {255, 247, 0}, {255, 249, 0}, {255, 250, 0}, {255, 251, 0}, {255, 252, 0}, {255, 253, 0}, {255, 254, 0}, {255, 255, 0}}};

const std::array<std::array<unsigned char, 3>, 256> geen_yellow_bytes = {
    {{27, 255, 84},   {27, 255, 84},   {29, 255, 85},   {30, 255, 86},   {32, 255, 87},   {33, 255, 88},   {35, 255, 89},   {36, 255, 91},   {38, 255, 92},   {39, 255, 93},   {41, 255, 94},   {42, 255, 95},   {44, 255, 96},   {45, 255, 97},
     {47, 255, 99},   {48, 255, 100},  {50, 255, 101},  {52, 255, 102},  {53, 255, 103},  {55, 255, 104},  {56, 255, 105},  {58, 255, 107},  {59, 255, 108},  {61, 255, 109},  {62, 255, 110},  {64, 255, 111},  {65, 255, 112},  {66, 255, 113},
     {68, 255, 115},  {69, 255, 116},  {71, 255, 117},  {72, 255, 118},  {74, 255, 119},  {75, 255, 120},  {77, 255, 121},  {79, 255, 123},  {80, 255, 124},  {82, 255, 125},  {83, 255, 126},  {85, 255, 127},  {86, 255, 128},  {88, 255, 129},
     {89, 255, 131},  {91, 255, 132},  {92, 255, 133},  {94, 255, 134},  {95, 255, 135},  {97, 255, 136},  {98, 255, 137},  {100, 255, 139}, {102, 255, 140}, {103, 255, 141}, {104, 255, 141}, {105, 255, 142}, {107, 255, 143}, {108, 255, 144},
     {110, 255, 146}, {111, 255, 147}, {113, 255, 148}, {114, 255, 149}, {116, 255, 150}, {117, 255, 151}, {119, 255, 153}, {120, 255, 154}, {122, 255, 155}, {123, 255, 156}, {125, 255, 157}, {127, 255, 158}, {128, 255, 159}, {130, 255, 161},
     {131, 255, 162}, {133, 255, 163}, {134, 255, 164}, {136, 255, 165}, {137, 255, 166}, {139, 255, 167}, {140, 255, 169}, {141, 255, 170}, {143, 255, 171}, {144, 255, 172}, {146, 255, 173}, {147, 255, 174}, {149, 255, 175}, {150, 255, 176},
     {152, 255, 178}, {154, 255, 179}, {155, 255, 180}, {157, 255, 181}, {158, 255, 182}, {160, 255, 183}, {161, 255, 185}, {163, 255, 186}, {164, 255, 187}, {166, 255, 188}, {167, 255, 189}, {169, 255, 190}, {170, 255, 191}, {172, 255, 193},
     {173, 255, 194}, {175, 255, 195}, {176, 255, 196}, {178, 255, 197}, {180, 255, 198}, {180, 255, 198}, {182, 255, 200}, {183, 255, 201}, {185, 255, 202}, {186, 255, 203}, {188, 255, 204}, {189, 255, 205}, {191, 255, 206}, {192, 255, 208},
     {194, 255, 209}, {195, 255, 210}, {197, 255, 211}, {198, 255, 212}, {200, 255, 213}, {201, 255, 214}, {203, 255, 216}, {205, 255, 217}, {206, 255, 218}, {208, 255, 219}, {209, 255, 220}, {211, 255, 221}, {212, 255, 223}, {214, 255, 224},
     {215, 255, 225}, {233, 255, 220}, {250, 255, 215}, {249, 255, 214}, {248, 255, 212}, {249, 255, 211}, {249, 255, 209}, {249, 255, 208}, {248, 255, 206}, {248, 255, 205}, {248, 255, 203}, {248, 255, 201}, {248, 255, 200}, {247, 255, 198},
     {247, 255, 197}, {246, 255, 195}, {247, 255, 194}, {247, 255, 192}, {246, 255, 191}, {246, 255, 189}, {246, 255, 188}, {246, 255, 186}, {246, 255, 185}, {246, 255, 183}, {245, 255, 182}, {245, 255, 180}, {245, 255, 179}, {245, 255, 178},
     {245, 255, 176}, {245, 255, 175}, {244, 255, 173}, {244, 255, 172}, {244, 255, 170}, {244, 255, 169}, {244, 255, 167}, {243, 255, 166}, {243, 255, 164}, {243, 255, 163}, {243, 255, 161}, {243, 255, 160}, {242, 255, 158}, {242, 255, 157},
     {242, 255, 155}, {242, 255, 154}, {242, 255, 152}, {241, 255, 150}, {241, 255, 149}, {241, 255, 147}, {241, 255, 146}, {241, 255, 144}, {241, 255, 143}, {240, 255, 141}, {240, 255, 140}, {240, 255, 139}, {240, 255, 137}, {240, 255, 136},
     {239, 255, 134}, {239, 255, 133}, {239, 255, 131}, {239, 255, 130}, {239, 255, 128}, {238, 255, 127}, {238, 255, 125}, {238, 255, 123}, {238, 255, 122}, {238, 255, 120}, {237, 255, 119}, {237, 255, 117}, {237, 255, 116}, {237, 255, 114},
     {237, 255, 113}, {237, 255, 111}, {236, 255, 110}, {236, 255, 108}, {236, 255, 107}, {236, 255, 105}, {236, 255, 104}, {235, 255, 102}, {235, 255, 101}, {235, 255, 100}, {235, 255, 98},  {235, 255, 97},  {235, 255, 95},  {234, 255, 94},
     {234, 255, 92},  {234, 255, 91},  {234, 255, 89},  {233, 255, 88},  {233, 255, 86},  {233, 255, 85},  {233, 255, 83},  {233, 255, 82},  {233, 255, 80},  {233, 255, 79},  {232, 255, 77},  {232, 255, 75},  {232, 255, 74},  {232, 255, 72},
     {231, 255, 71},  {231, 255, 69},  {231, 255, 68},  {231, 255, 66},  {231, 255, 65},  {231, 255, 63},  {230, 255, 62},  {230, 255, 61},  {230, 255, 59},  {230, 255, 58},  {229, 255, 56},  {229, 255, 55},  {229, 255, 53},  {228, 255, 52},
     {229, 255, 50},  {229, 255, 48},  {228, 255, 47},  {228, 255, 45},  {228, 255, 44},  {228, 255, 42},  {227, 255, 41},  {228, 255, 39},  {227, 255, 38},  {227, 255, 36},  {227, 255, 35},  {227, 255, 33},  {227, 255, 32},  {226, 255, 30},
     {226, 255, 29},  {226, 255, 27},  {226, 255, 26},  {226, 255, 25}}};

const std::array<std::array<unsigned char, 3>, 256> blue_red_bytes = {
    {{42, 0, 127},    {42, 0, 130},    {42, 0, 133},    {42, 0, 136},    {42, 0, 139},    {41, 0, 142},    {41, 0, 145},    {41, 0, 148},    {40, 0, 151},    {40, 0, 154},    {40, 0, 157},    {39, 0, 160},    {39, 0, 163},    {38, 0, 166},
     {37, 0, 169},    {37, 0, 172},    {36, 0, 175},    {35, 0, 178},    {34, 0, 181},    {34, 0, 184},    {33, 0, 187},    {32, 0, 190},    {31, 0, 193},    {30, 0, 196},    {28, 0, 199},    {27, 0, 202},    {26, 0, 205},    {25, 0, 208},
     {24, 0, 211},    {22, 0, 214},    {21, 0, 217},    {19, 0, 220},    {18, 0, 223},    {16, 0, 226},    {15, 0, 229},    {13, 0, 232},    {12, 0, 235},    {10, 0, 238},    {8, 0, 241},     {6, 0, 244},     {4, 0, 247},     {2, 0, 250},
     {0, 0, 253},     {1, 2, 255},     {4, 7, 255},     {7, 12, 255},    {10, 17, 255},   {13, 22, 255},   {16, 26, 255},   {19, 31, 255},   {22, 36, 255},   {25, 40, 255},   {28, 45, 255},   {31, 49, 255},   {34, 54, 255},   {37, 58, 255},
     {40, 63, 255},   {43, 67, 255},   {46, 71, 255},   {49, 76, 255},   {52, 80, 255},   {55, 84, 255},   {58, 88, 255},   {61, 92, 255},   {64, 96, 255},   {67, 100, 255},  {70, 104, 255},  {73, 108, 255},  {76, 112, 255},  {79, 115, 255},
     {82, 119, 255},  {85, 123, 255},  {88, 127, 255},  {91, 130, 255},  {94, 134, 255},  {97, 137, 255},  {100, 141, 255}, {103, 144, 255}, {106, 147, 255}, {109, 151, 255}, {112, 154, 255}, {115, 157, 255}, {118, 160, 255}, {121, 163, 255},
     {124, 166, 255}, {127, 170, 255}, {130, 172, 255}, {133, 175, 255}, {136, 178, 255}, {139, 181, 255}, {142, 184, 255}, {145, 187, 255}, {148, 189, 255}, {151, 192, 255}, {154, 195, 255}, {157, 197, 255}, {160, 200, 255}, {163, 202, 255},
     {166, 205, 255}, {169, 207, 255}, {172, 209, 255}, {175, 211, 255}, {178, 214, 255}, {181, 216, 255}, {184, 218, 255}, {187, 220, 255}, {190, 222, 255}, {193, 224, 255}, {196, 226, 255}, {199, 228, 255}, {202, 230, 255}, {205, 232, 255},
     {208, 233, 255}, {211, 235, 255}, {214, 237, 255}, {217, 238, 255}, {220, 240, 255}, {223, 241, 255}, {226, 243, 255}, {229, 244, 255}, {232, 246, 255}, {235, 247, 255}, {238, 248, 255}, {241, 250, 255}, {244, 251, 255}, {247, 252, 255},
     {250, 253, 255}, {253, 254, 255}, {255, 254, 253}, {255, 253, 250}, {255, 252, 247}, {255, 251, 244}, {255, 250, 241}, {255, 248, 238}, {255, 247, 235}, {255, 246, 232}, {255, 244, 229}, {255, 243, 226}, {255, 241, 223}, {255, 240, 220},
     {255, 238, 217}, {255, 237, 214}, {255, 235, 211}, {255, 233, 208}, {255, 232, 205}, {255, 230, 202}, {255, 228, 199}, {255, 226, 196}, {255, 224, 193}, {255, 222, 190}, {255, 220, 187}, {255, 218, 184}, {255, 216, 181}, {255, 214, 178},
     {255, 211, 175}, {255, 209, 172}, {255, 207, 169}, {255, 205, 166}, {255, 202, 163}, {255, 200, 160}, {255, 197, 157}, {255, 195, 154}, {255, 192, 151}, {255, 189, 148}, {255, 187, 145}, {255, 184, 142}, {255, 181, 139}, {255, 178, 136},
     {255, 175, 133}, {255, 172, 130}, {255, 169, 127}, {255, 166, 124}, {255, 163, 121}, {255, 160, 118}, {255, 157, 115}, {255, 154, 112}, {255, 151, 109}, {255, 147, 106}, {255, 144, 103}, {255, 141, 100}, {255, 137, 97},  {255, 134, 94},
     {255, 130, 91},  {255, 127, 88},  {255, 123, 85},  {255, 119, 82},  {255, 115, 79},  {255, 112, 76},  {255, 108, 73},  {255, 104, 70},  {255, 100, 67},  {255, 96, 64},   {255, 92, 61},   {255, 88, 58},   {255, 84, 55},   {255, 80, 52},
     {255, 76, 49},   {255, 71, 46},   {255, 67, 43},   {255, 63, 40},   {255, 58, 37},   {255, 54, 34},   {255, 49, 31},   {255, 45, 28},   {255, 40, 25},   {255, 36, 22},   {255, 31, 19},   {255, 26, 16},   {255, 22, 13},   {255, 17, 10},
     {255, 12, 7},    {255, 7, 4},     {255, 2, 1},     {253, 0, 0},     {250, 0, 2},     {247, 0, 4},     {244, 0, 6},     {241, 0, 8},     {238, 0, 10},    {235, 0, 12},    {232, 0, 13},    {229, 0, 15},    {226, 0, 16},    {223, 0, 18},
     {220, 0, 19},    {217, 0, 21},    {214, 0, 22},    {211, 0, 24},    {208, 0, 25},    {205, 0, 26},    {202, 0, 27},    {199, 0, 28},    {196, 0, 30},    {193, 0, 31},    {190, 0, 32},    {187, 0, 33},    {184, 0, 34},    {181, 0, 34},
     {178, 0, 35},    {175, 0, 36},    {172, 0, 37},    {169, 0, 37},    {166, 0, 38},    {163, 0, 39},    {160, 0, 39},    {157, 0, 40},    {154, 0, 40},    {151, 0, 40},    {148, 0, 41},    {145, 0, 41},    {142, 0, 41},    {139, 0, 42},
     {136, 0, 42},    {133, 0, 42},    {130, 0, 42},    {127, 0, 42}}};

const std::array<std::array<unsigned char, 3>, 256> pubugn_bytes = {
    {{254, 246, 250}, {253, 245, 250}, {253, 245, 249}, {252, 244, 249}, {252, 243, 249}, {251, 243, 248}, {250, 242, 248}, {250, 241, 248}, {249, 241, 247}, {249, 240, 247}, {248, 239, 247}, {247, 239, 246}, {247, 238, 246}, {246, 237, 246},
     {246, 237, 245}, {245, 236, 245}, {244, 235, 245}, {244, 235, 244}, {244, 235, 244}, {243, 234, 244}, {242, 233, 243}, {242, 232, 243}, {241, 232, 243}, {241, 231, 242}, {240, 230, 242}, {239, 230, 242}, {239, 229, 242}, {238, 228, 241},
     {237, 228, 241}, {237, 227, 240}, {237, 227, 240}, {236, 226, 240}, {235, 225, 239}, {234, 224, 239}, {233, 224, 239}, {232, 224, 238}, {232, 223, 238}, {231, 223, 238}, {229, 222, 237}, {228, 221, 237}, {228, 221, 237}, {227, 220, 236},
     {226, 220, 236}, {225, 219, 236}, {225, 219, 236}, {224, 218, 235}, {222, 218, 235}, {221, 217, 234}, {221, 216, 234}, {220, 216, 234}, {219, 215, 234}, {218, 215, 233}, {218, 215, 233}, {217, 214, 233}, {215, 213, 232}, {214, 213, 232},
     {214, 212, 232}, {213, 212, 231}, {212, 211, 231}, {211, 211, 231}, {211, 211, 231}, {210, 210, 230}, {208, 209, 230}, {207, 208, 229}, {206, 208, 229}, {205, 207, 229}, {204, 207, 228}, {202, 206, 228}, {201, 205, 228}, {200, 205, 227},
     {198, 204, 227}, {197, 203, 227}, {196, 203, 226}, {195, 202, 226}, {194, 202, 226}, {193, 201, 226}, {191, 200, 225}, {189, 200, 225}, {188, 199, 224}, {186, 198, 224}, {185, 198, 224}, {184, 197, 223}, {183, 197, 223}, {181, 196, 223},
     {180, 195, 222}, {179, 195, 222}, {177, 194, 222}, {176, 193, 221}, {175, 193, 221}, {174, 192, 221}, {173, 192, 221}, {172, 191, 220}, {170, 190, 220}, {168, 190, 219}, {167, 189, 219}, {165, 188, 218}, {163, 188, 218}, {162, 187, 218},
     {160, 187, 217}, {158, 186, 217}, {156, 185, 217}, {154, 185, 216}, {152, 184, 216}, {150, 183, 215}, {148, 183, 215}, {146, 182, 215}, {145, 182, 215}, {143, 181, 214}, {140, 181, 214}, {138, 180, 213}, {136, 179, 213}, {134, 178, 212},
     {132, 178, 212}, {130, 177, 212}, {128, 177, 211}, {126, 176, 211}, {124, 175, 211}, {122, 175, 210}, {120, 174, 210}, {118, 173, 209}, {116, 173, 209}, {115, 172, 209}, {114, 172, 209}, {112, 171, 208}, {109, 171, 208}, {106, 170, 207},
     {104, 169, 207}, {103, 168, 206}, {101, 168, 206}, {99, 167, 206},  {98, 166, 205},  {96, 165, 205},  {95, 165, 204},  {93, 164, 204},  {92, 163, 203},  {90, 162, 203},  {89, 161, 202},  {87, 161, 202},  {86, 160, 201},  {84, 159, 201},
     {83, 158, 200},  {81, 158, 200},  {80, 157, 199},  {78, 156, 199},  {76, 155, 199},  {75, 154, 198},  {73, 154, 198},  {72, 153, 197},  {70, 152, 197},  {69, 151, 196},  {68, 151, 196},  {67, 150, 196},  {65, 149, 195},  {63, 148, 194},
     {61, 147, 194},  {60, 147, 193},  {58, 146, 193},  {57, 145, 192},  {55, 144, 192},  {53, 144, 191},  {52, 143, 190},  {50, 143, 188},  {49, 142, 186},  {47, 142, 185},  {45, 141, 183},  {44, 141, 181},  {42, 140, 180},  {40, 140, 178},
     {39, 139, 176},  {37, 139, 175},  {36, 138, 173},  {34, 138, 171},  {32, 137, 170},  {31, 137, 168},  {29, 136, 166},  {27, 136, 164},  {26, 136, 163},  {24, 135, 161},  {23, 135, 159},  {21, 134, 158},  {19, 134, 156},  {18, 133, 155},
     {17, 133, 154},  {16, 133, 152},  {13, 132, 150},  {11, 131, 148},  {10, 131, 146},  {8, 130, 144},   {6, 130, 143},   {5, 129, 141},   {3, 129, 139},   {2, 128, 138},   {2, 128, 136},   {1, 127, 134},   {1, 127, 133},   {1, 126, 131},
     {1, 125, 130},   {1, 125, 128},   {1, 124, 127},   {1, 123, 125},   {1, 123, 124},   {1, 122, 122},   {1, 121, 121},   {1, 121, 119},   {1, 120, 118},   {1, 119, 116},   {1, 119, 115},   {1, 118, 113},   {1, 117, 111},   {1, 117, 110},
     {1, 116, 108},   {1, 115, 107},   {1, 115, 105},   {1, 114, 104},   {1, 114, 103},   {1, 113, 102},   {1, 112, 100},   {1, 111, 98},    {1, 111, 96},    {1, 110, 95},    {1, 109, 93},    {1, 109, 92},    {1, 108, 90},    {1, 107, 89},
     {1, 106, 87},    {1, 105, 86},    {1, 104, 85},    {1, 103, 84},    {1, 102, 83},    {1, 100, 82},    {1, 99, 81},     {1, 98, 80},     {1, 97, 79},     {1, 96, 78},     {1, 94, 76},     {1, 93, 75},     {1, 92, 74},     {1, 91, 73},
     {1, 90, 72},     {1, 88, 71},     {1, 87, 70},     {1, 86, 69},     {1, 85, 68},     {1, 84, 67},     {1, 83, 66},     {1, 81, 64},     {1, 81, 64},     {1, 80, 63},     {1, 78, 62},     {1, 77, 60},     {1, 75, 59},     {1, 74, 58},
     {1, 73, 57},     {1, 72, 56},     {1, 71, 55},     {1, 70, 54}}};

const std::array<std::array<unsigned char, 3>, 256> summer_bytes = {
    {{1, 128, 102},   {1, 128, 102},   {2, 128, 102},   {3, 129, 102},   {4, 129, 102},   {5, 130, 102},   {6, 130, 102},   {7, 131, 102},   {8, 131, 102},   {9, 132, 102},   {10, 132, 102},  {11, 133, 102},  {12, 133, 102},  {13, 134, 102},
     {14, 134, 102},  {15, 135, 102},  {16, 135, 102},  {17, 136, 102},  {17, 136, 102},  {19, 137, 102},  {20, 137, 102},  {21, 138, 102},  {21, 138, 102},  {23, 139, 102},  {24, 139, 102},  {25, 140, 102},  {25, 140, 102},  {27, 141, 102},
     {28, 141, 102},  {29, 142, 102},  {29, 142, 102},  {31, 143, 102},  {32, 143, 102},  {33, 144, 102},  {34, 144, 102},  {35, 145, 102},  {35, 145, 102},  {37, 146, 102},  {38, 146, 102},  {39, 147, 102},  {40, 147, 102},  {41, 148, 102},
     {42, 148, 102},  {43, 149, 102},  {43, 149, 102},  {45, 150, 102},  {46, 150, 102},  {47, 151, 102},  {48, 151, 102},  {49, 152, 102},  {50, 152, 102},  {51, 153, 102},  {51, 153, 102},  {53, 154, 102},  {54, 154, 102},  {55, 155, 102},
     {56, 155, 102},  {57, 156, 102},  {58, 156, 102},  {59, 157, 102},  {59, 157, 102},  {61, 158, 102},  {62, 158, 102},  {63, 159, 102},  {64, 159, 102},  {65, 160, 102},  {66, 160, 102},  {67, 161, 102},  {68, 161, 102},  {69, 162, 102},
     {70, 162, 102},  {71, 163, 102},  {72, 163, 102},  {73, 164, 102},  {73, 164, 102},  {75, 165, 102},  {76, 165, 102},  {77, 166, 102},  {78, 166, 102},  {79, 167, 102},  {80, 167, 102},  {81, 168, 102},  {82, 168, 102},  {83, 169, 102},
     {84, 169, 102},  {85, 170, 102},  {86, 170, 102},  {87, 171, 102},  {88, 171, 102},  {89, 172, 102},  {89, 172, 102},  {90, 172, 102},  {92, 173, 102},  {93, 174, 102},  {94, 174, 102},  {95, 175, 102},  {96, 175, 102},  {97, 176, 102},
     {98, 176, 102},  {99, 177, 102},  {100, 177, 102}, {101, 178, 102}, {102, 178, 102}, {103, 179, 102}, {104, 179, 102}, {105, 180, 102}, {105, 180, 102}, {106, 180, 102}, {108, 181, 102}, {109, 182, 102}, {110, 182, 102}, {111, 183, 102},
     {112, 183, 102}, {113, 184, 102}, {114, 184, 102}, {115, 185, 102}, {116, 185, 102}, {117, 186, 102}, {118, 186, 102}, {119, 187, 102}, {120, 187, 102}, {121, 188, 102}, {121, 188, 102}, {122, 188, 102}, {124, 189, 102}, {125, 190, 102},
     {126, 190, 102}, {127, 191, 102}, {128, 191, 102}, {129, 192, 102}, {130, 192, 102}, {131, 193, 102}, {132, 193, 102}, {133, 194, 102}, {134, 194, 102}, {135, 195, 102}, {136, 195, 102}, {137, 196, 102}, {138, 196, 102}, {139, 197, 102},
     {140, 197, 102}, {141, 198, 102}, {142, 198, 102}, {143, 199, 102}, {144, 199, 102}, {145, 200, 102}, {146, 200, 102}, {147, 201, 102}, {148, 201, 102}, {149, 202, 102}, {149, 202, 102}, {150, 202, 102}, {152, 203, 102}, {153, 204, 102},
     {154, 204, 102}, {155, 205, 102}, {156, 205, 102}, {157, 206, 102}, {158, 206, 102}, {159, 207, 102}, {160, 207, 102}, {161, 208, 102}, {162, 208, 102}, {163, 209, 102}, {164, 209, 102}, {165, 210, 102}, {166, 210, 102}, {167, 211, 102},
     {168, 211, 102}, {169, 212, 102}, {170, 212, 102}, {171, 213, 102}, {172, 213, 102}, {173, 214, 102}, {174, 214, 102}, {175, 215, 102}, {176, 215, 102}, {177, 216, 102}, {178, 216, 102}, {179, 217, 102}, {180, 217, 102}, {181, 218, 102},
     {181, 218, 102}, {182, 218, 102}, {183, 219, 102}, {185, 220, 102}, {186, 220, 102}, {187, 221, 102}, {188, 221, 102}, {189, 222, 102}, {190, 222, 102}, {191, 223, 102}, {192, 223, 102}, {193, 224, 102}, {194, 224, 102}, {195, 225, 102},
     {196, 225, 102}, {197, 226, 102}, {198, 226, 102}, {199, 227, 102}, {200, 227, 102}, {201, 228, 102}, {202, 228, 102}, {203, 229, 102}, {204, 229, 102}, {205, 230, 102}, {206, 230, 102}, {207, 231, 102}, {208, 231, 102}, {209, 232, 102},
     {210, 232, 102}, {211, 233, 102}, {212, 233, 102}, {213, 234, 102}, {213, 234, 102}, {214, 234, 102}, {215, 235, 102}, {217, 236, 102}, {218, 236, 102}, {219, 237, 102}, {220, 237, 102}, {221, 238, 102}, {222, 238, 102}, {223, 239, 102},
     {224, 239, 102}, {225, 240, 102}, {226, 240, 102}, {227, 241, 102}, {228, 241, 102}, {229, 242, 102}, {230, 242, 102}, {231, 243, 102}, {232, 243, 102}, {233, 244, 102}, {234, 244, 102}, {235, 245, 102}, {236, 245, 102}, {237, 246, 102},
     {238, 246, 102}, {239, 247, 102}, {240, 247, 102}, {241, 248, 102}, {242, 248, 102}, {243, 249, 102}, {244, 249, 102}, {245, 250, 102}, {245, 250, 102}, {246, 250, 102}, {247, 251, 102}, {249, 252, 102}, {250, 252, 102}, {251, 253, 102},
     {252, 253, 102}, {253, 254, 102}, {254, 254, 102}, {255, 255, 102}}};

const std::array<std::array<unsigned char, 3>, 256> turbid_bytes = {
    {{233, 246, 171}, {232, 245, 170}, {232, 243, 168}, {231, 242, 167}, {230, 241, 165}, {230, 240, 164}, {229, 239, 162}, {229, 238, 161}, {228, 236, 159}, {228, 235, 158}, {227, 234, 156}, {227, 233, 155}, {226, 232, 154}, {226, 231, 152},
     {225, 229, 151}, {224, 228, 149}, {224, 227, 148}, {223, 226, 146}, {223, 225, 145}, {222, 224, 143}, {222, 223, 142}, {221, 221, 141}, {221, 220, 139}, {220, 219, 138}, {220, 218, 136}, {219, 217, 135}, {219, 216, 134}, {218, 215, 132},
     {218, 213, 131}, {217, 212, 130}, {217, 211, 128}, {217, 210, 127}, {216, 209, 126}, {216, 208, 124}, {215, 207, 123}, {215, 206, 122}, {214, 204, 120}, {214, 203, 119}, {213, 202, 118}, {213, 201, 116}, {212, 200, 115}, {212, 199, 114},
     {211, 198, 113}, {211, 197, 111}, {211, 195, 110}, {210, 194, 109}, {210, 193, 108}, {209, 192, 107}, {209, 191, 105}, {208, 190, 104}, {208, 189, 103}, {207, 188, 102}, {207, 187, 101}, {207, 186, 100}, {206, 184, 98},  {206, 183, 97},
     {205, 182, 96},  {205, 181, 95},  {204, 180, 94},  {204, 179, 93},  {203, 178, 92},  {203, 177, 91},  {202, 176, 90},  {202, 175, 89},  {202, 174, 88},  {201, 172, 87},  {201, 171, 86},  {200, 170, 85},  {200, 169, 84},  {199, 168, 83},
     {199, 167, 82},  {198, 166, 81},  {198, 165, 81},  {197, 164, 80},  {197, 163, 79},  {196, 162, 78},  {196, 161, 77},  {195, 160, 77},  {195, 159, 76},  {194, 158, 75},  {194, 156, 74},  {193, 155, 74},  {193, 154, 73},  {192, 153, 72},
     {192, 152, 72},  {191, 151, 71},  {191, 150, 71},  {190, 149, 70},  {189, 148, 69},  {189, 147, 69},  {188, 146, 68},  {188, 145, 68},  {187, 144, 67},  {187, 143, 67},  {186, 142, 66},  {185, 141, 66},  {185, 140, 66},  {184, 139, 65},
     {183, 138, 65},  {183, 137, 64},  {182, 137, 64},  {182, 136, 64},  {181, 135, 64},  {180, 134, 63},  {179, 133, 63},  {179, 132, 63},  {178, 131, 62},  {177, 130, 62},  {177, 129, 62},  {176, 128, 62},  {175, 127, 61},  {175, 126, 61},
     {174, 125, 61},  {173, 125, 61},  {172, 124, 61},  {172, 123, 61},  {171, 122, 60},  {170, 121, 60},  {169, 120, 60},  {168, 119, 60},  {168, 119, 60},  {167, 118, 60},  {166, 117, 60},  {165, 116, 60},  {164, 115, 59},  {164, 114, 59},
     {163, 114, 59},  {162, 113, 59},  {161, 112, 59},  {160, 111, 59},  {159, 110, 59},  {158, 110, 59},  {158, 109, 59},  {157, 108, 59},  {156, 107, 59},  {155, 107, 59},  {154, 106, 59},  {153, 105, 59},  {152, 104, 59},  {151, 104, 58},
     {150, 103, 58},  {150, 102, 58},  {149, 101, 58},  {148, 101, 58},  {147, 100, 58},  {146, 99, 58},   {145, 98, 58},   {144, 98, 58},   {143, 97, 58},   {142, 96, 58},   {141, 96, 58},   {140, 95, 58},   {139, 94, 58},   {138, 94, 58},
     {137, 93, 58},   {136, 92, 58},   {135, 92, 57},   {134, 91, 57},   {133, 90, 57},   {132, 90, 57},   {131, 89, 57},   {130, 88, 57},   {129, 88, 57},   {128, 87, 57},   {127, 86, 57},   {126, 86, 57},   {125, 85, 56},   {124, 84, 56},
     {123, 84, 56},   {122, 83, 56},   {121, 83, 56},   {120, 82, 56},   {119, 81, 56},   {118, 81, 56},   {117, 80, 55},   {116, 79, 55},   {115, 79, 55},   {114, 78, 55},   {113, 78, 55},   {112, 77, 55},   {111, 76, 54},   {110, 76, 54},
     {109, 75, 54},   {108, 75, 54},   {107, 74, 53},   {106, 73, 53},   {105, 73, 53},   {103, 72, 53},   {102, 72, 53},   {101, 71, 52},   {100, 70, 52},   {99, 70, 52},    {98, 69, 52},    {97, 69, 51},    {96, 68, 51},    {95, 67, 51},
     {94, 67, 51},    {93, 66, 50},    {92, 66, 50},    {91, 65, 50},    {90, 65, 49},    {89, 64, 49},    {88, 63, 49},    {87, 63, 48},    {86, 62, 48},    {85, 62, 48},    {84, 61, 48},    {83, 60, 47},    {82, 60, 47},    {81, 59, 47},
     {80, 59, 46},    {79, 58, 46},    {78, 57, 46},    {77, 57, 45},    {75, 56, 45},    {74, 56, 44},    {73, 55, 44},    {72, 54, 44},    {71, 54, 43},    {70, 53, 43},    {69, 53, 43},    {68, 52, 42},    {67, 51, 42},    {66, 51, 41},
     {65, 50, 41},    {64, 50, 41},    {63, 49, 40},    {62, 48, 40},    {61, 48, 39},    {60, 47, 39},    {59, 47, 39},    {58, 46, 38},    {57, 45, 38},    {56, 45, 37},    {55, 44, 37},    {54, 43, 36},    {53, 43, 36},    {52, 42, 36},
     {51, 42, 35},    {50, 41, 35},    {49, 40, 34},    {48, 40, 34},    {47, 39, 33},    {46, 38, 33},    {45, 38, 32},    {44, 37, 32},    {43, 36, 31},    {42, 36, 31},    {41, 35, 31},    {40, 35, 30},    {39, 34, 30},    {38, 33, 29},
     {37, 33, 29},    {36, 32, 28},    {35, 31, 28},    {34, 31, 27}}};

const std::array<std::array<unsigned char, 3>, 256> pastel_bytes = {
    {{248, 180, 175}, {246, 181, 177}, {244, 182, 178}, {241, 183, 180}, {239, 183, 182}, {237, 184, 183}, {235, 185, 185}, {232, 186, 187}, {230, 187, 188}, {228, 187, 190}, {226, 188, 192}, {223, 189, 193}, {221, 190, 195}, {219, 190, 197},
     {217, 191, 198}, {214, 192, 200}, {212, 193, 202}, {211, 193, 203}, {210, 194, 203}, {207, 195, 206}, {203, 196, 208}, {202, 196, 209}, {201, 197, 210}, {198, 198, 212}, {194, 199, 215}, {193, 199, 216}, {192, 200, 217}, {189, 201, 219},
     {185, 202, 221}, {184, 203, 222}, {183, 203, 223}, {181, 204, 224}, {180, 205, 225}, {180, 206, 225}, {181, 207, 224}, {181, 208, 223}, {182, 208, 223}, {183, 210, 221}, {184, 211, 220}, {185, 212, 219}, {186, 213, 218}, {186, 214, 217},
     {187, 215, 216}, {188, 215, 216}, {188, 216, 215}, {189, 217, 214}, {190, 218, 213}, {191, 220, 211}, {192, 220, 211}, {193, 221, 210}, {193, 222, 209}, {194, 223, 208}, {194, 223, 208}, {195, 225, 206}, {196, 226, 205}, {197, 227, 204},
     {198, 228, 203}, {199, 229, 202}, {200, 230, 201}, {200, 230, 201}, {200, 231, 200}, {201, 232, 199}, {203, 233, 198}, {203, 234, 197}, {204, 233, 198}, {205, 232, 198}, {205, 231, 199}, {206, 230, 200}, {206, 229, 201}, {207, 228, 202},
     {207, 227, 203}, {208, 226, 204}, {209, 225, 205}, {209, 225, 206}, {209, 224, 206}, {210, 223, 207}, {211, 222, 209}, {211, 220, 210}, {212, 219, 211}, {213, 218, 212}, {213, 217, 213}, {214, 216, 214}, {214, 215, 215}, {215, 214, 216},
     {215, 213, 217}, {216, 212, 218}, {216, 211, 219}, {217, 210, 220}, {218, 209, 221}, {218, 209, 221}, {218, 208, 222}, {219, 207, 223}, {220, 206, 224}, {220, 204, 226}, {221, 203, 227}, {222, 203, 226}, {223, 203, 225}, {224, 203, 224},
     {225, 204, 222}, {226, 204, 220}, {227, 205, 218}, {228, 205, 216}, {229, 206, 214}, {230, 206, 212}, {231, 206, 210}, {231, 207, 209}, {232, 207, 208}, {233, 207, 206}, {234, 208, 203}, {236, 209, 200}, {237, 209, 198}, {238, 210, 196},
     {239, 210, 195}, {240, 210, 193}, {241, 211, 191}, {242, 211, 189}, {243, 212, 187}, {244, 212, 185}, {245, 213, 183}, {246, 213, 181}, {247, 213, 179}, {247, 214, 178}, {248, 214, 177}, {249, 214, 175}, {250, 215, 172}, {252, 216, 169},
     {253, 216, 167}, {253, 217, 167}, {253, 218, 167}, {254, 219, 168}, {254, 220, 169}, {254, 221, 170}, {254, 222, 171}, {254, 224, 173}, {254, 225, 174}, {254, 226, 175}, {254, 227, 176}, {254, 228, 177}, {254, 230, 179}, {254, 231, 180},
     {254, 232, 181}, {254, 233, 182}, {254, 234, 183}, {254, 236, 185}, {254, 237, 186}, {254, 238, 187}, {254, 239, 188}, {254, 240, 189}, {254, 241, 190}, {254, 242, 191}, {254, 243, 192}, {254, 244, 193}, {254, 246, 195}, {254, 247, 196},
     {254, 249, 198}, {254, 250, 199}, {254, 251, 200}, {254, 252, 201}, {254, 253, 202}, {254, 254, 203}, {254, 253, 203}, {253, 252, 203}, {252, 251, 202}, {251, 250, 202}, {250, 248, 201}, {250, 247, 201}, {249, 246, 200}, {248, 245, 200},
     {247, 244, 199}, {246, 242, 199}, {246, 241, 198}, {245, 240, 198}, {244, 239, 197}, {243, 237, 197}, {242, 236, 196}, {241, 235, 196}, {241, 234, 196}, {240, 233, 195}, {239, 231, 195}, {238, 230, 194}, {237, 229, 194}, {237, 228, 193},
     {236, 227, 193}, {236, 226, 193}, {234, 224, 192}, {233, 223, 191}, {233, 222, 191}, {232, 220, 190}, {231, 219, 190}, {230, 218, 189}, {229, 217, 189}, {229, 216, 189}, {229, 216, 190}, {230, 216, 191}, {231, 216, 193}, {232, 216, 194},
     {232, 216, 196}, {233, 216, 197}, {234, 216, 199}, {235, 216, 200}, {235, 216, 202}, {236, 216, 203}, {237, 216, 205}, {238, 216, 206}, {238, 216, 208}, {239, 216, 209}, {240, 216, 211}, {241, 216, 212}, {241, 217, 213}, {242, 217, 215},
     {243, 217, 216}, {244, 217, 218}, {244, 217, 219}, {245, 217, 221}, {245, 217, 221}, {246, 217, 222}, {247, 217, 225}, {248, 217, 227}, {249, 217, 228}, {250, 217, 230}, {250, 217, 231}, {251, 217, 233}, {252, 217, 234}, {252, 218, 235},
     {252, 218, 236}, {252, 219, 236}, {251, 220, 236}, {251, 221, 236}, {251, 221, 236}, {250, 222, 237}, {250, 223, 237}, {250, 224, 237}, {249, 224, 237}, {249, 225, 237}, {249, 226, 238}, {248, 227, 238}, {248, 227, 238}, {248, 228, 238},
     {247, 229, 238}, {247, 230, 239}, {247, 230, 239}, {246, 231, 239}, {246, 232, 239}, {246, 233, 239}, {245, 233, 239}, {245, 234, 240}, {245, 234, 240}, {245, 235, 240}, {244, 236, 240}, {244, 237, 240}, {243, 238, 241}, {243, 239, 241},
     {243, 239, 241}, {242, 240, 241}, {242, 241, 241}, {242, 242, 242}}};

const std::array<std::array<unsigned char, 3>, 256> helix_bytes = {
    {{0, 0, 0},     {0, 0, 0},     {0, 0, 0},      {1, 1, 0},      {2, 1, 0},      {3, 2, 0},      {4, 2, 0},      {5, 3, 0},      {6, 4, 0},     {7, 4, 0},     {7, 5, 0},     {8, 6, 0},      {9, 6, 0},      {10, 7, 0},     {10, 8, 0},
     {11, 9, 0},    {12, 10, 0},   {12, 11, 0},    {13, 11, 0},    {14, 12, 0},    {14, 13, 0},    {15, 14, 0},    {15, 15, 0},    {16, 16, 0},   {16, 17, 0},   {17, 18, 0},   {17, 19, 0},    {18, 20, 0},    {18, 21, 0},    {18, 22, 0},
     {19, 24, 0},   {19, 25, 0},   {19, 26, 0},    {20, 27, 0},    {20, 28, 0},    {20, 29, 0},    {20, 30, 0},    {20, 32, 1},    {21, 33, 1},   {21, 34, 1},   {21, 35, 1},   {21, 36, 2},    {21, 38, 2},    {21, 39, 2},    {21, 40, 2},
     {21, 41, 3},   {21, 42, 3},   {21, 43, 4},    {20, 45, 4},    {20, 46, 4},    {20, 47, 5},    {20, 48, 5},    {20, 49, 6},    {19, 51, 7},   {19, 52, 7},   {19, 53, 8},   {18, 54, 8},    {18, 55, 9},    {18, 56, 10},   {17, 57, 10},
     {17, 58, 11},  {17, 59, 12},  {16, 60, 13},   {16, 61, 14},   {16, 62, 15},   {15, 63, 15},   {15, 64, 16},   {14, 65, 17},   {14, 66, 18},  {13, 67, 19},  {13, 68, 21},  {12, 69, 22},   {12, 70, 23},   {11, 71, 24},   {11, 72, 25},
     {10, 72, 26},  {10, 73, 28},  {9, 74, 29},    {9, 75, 30},    {8, 75, 32},    {8, 76, 33},    {7, 76, 34},    {7, 77, 36},    {6, 78, 37},   {6, 78, 39},   {5, 79, 40},   {5, 79, 42},    {4, 79, 43},    {4, 80, 45},    {4, 80, 46},
     {3, 80, 48},   {3, 81, 50},   {2, 81, 51},    {2, 81, 53},    {2, 81, 55},    {1, 81, 56},    {1, 81, 58},    {1, 81, 60},    {1, 81, 62},   {0, 81, 63},   {0, 81, 65},   {0, 81, 67},    {0, 81, 69},    {0, 81, 71},    {0, 80, 73},
     {0, 80, 74},   {0, 80, 76},   {0, 79, 78},    {0, 79, 80},    {0, 79, 82},    {0, 78, 84},    {0, 77, 86},    {0, 77, 88},    {0, 76, 90},   {0, 76, 91},   {0, 75, 93},   {1, 74, 95},    {1, 74, 97},    {1, 73, 99},    {2, 72, 101},
     {2, 71, 103},  {3, 70, 105},  {3, 69, 106},   {4, 69, 108},   {4, 68, 110},   {5, 67, 112},   {6, 66, 114},   {6, 65, 115},   {6, 65, 116},  {7, 64, 118},  {8, 62, 120},  {9, 61, 121},   {10, 60, 123},  {11, 59, 125},  {12, 58, 126},
     {13, 57, 128}, {14, 55, 129}, {15, 54, 131},  {17, 53, 132},  {18, 52, 134},  {19, 50, 135},  {21, 49, 137},  {22, 48, 138},  {24, 47, 139}, {25, 45, 141}, {27, 44, 142}, {28, 43, 143},  {30, 41, 144},  {32, 40, 145},  {33, 39, 146},
     {35, 37, 147}, {37, 36, 148}, {39, 35, 149},  {41, 33, 150},  {43, 32, 151},  {45, 31, 152},  {47, 29, 153},  {49, 28, 154},  {51, 27, 154}, {53, 25, 155}, {56, 24, 156}, {58, 23, 156},  {60, 22, 157},  {62, 20, 157},  {65, 19, 158},
     {67, 18, 158}, {70, 17, 158}, {72, 16, 158},  {74, 15, 159},  {77, 14, 159},  {79, 13, 159},  {82, 12, 159},  {84, 11, 159},  {87, 10, 159}, {89, 9, 158},  {92, 8, 158},  {95, 7, 158},   {97, 6, 157},   {100, 5, 157},  {103, 5, 156},
     {105, 4, 156}, {108, 3, 155}, {111, 3, 155},  {114, 2, 154},  {116, 2, 153},  {119, 1, 152},  {122, 1, 151},  {125, 1, 150},  {128, 0, 149}, {130, 0, 148}, {133, 0, 147}, {136, 0, 146},  {139, 0, 145},  {141, 0, 144},  {144, 0, 142},
     {147, 0, 141}, {150, 0, 140}, {153, 0, 138},  {155, 0, 137},  {158, 0, 135},  {161, 1, 134},  {163, 1, 132},  {166, 1, 131},  {169, 2, 129}, {171, 3, 127}, {174, 3, 125}, {177, 4, 124},  {179, 5, 122},  {182, 6, 120},  {184, 6, 118},
     {186, 7, 116}, {189, 8, 114}, {191, 10, 112}, {193, 11, 110}, {196, 12, 108}, {198, 13, 106}, {200, 15, 104}, {202, 16, 102}, {204, 18, 99}, {206, 19, 97}, {209, 21, 95}, {211, 23, 93},  {212, 24, 91},  {214, 26, 88},  {216, 28, 86},
     {218, 30, 84}, {220, 32, 82}, {221, 34, 79},  {223, 37, 77},  {224, 39, 75},  {226, 41, 72},  {227, 44, 70},  {229, 46, 68},  {230, 48, 65}, {231, 51, 63}, {232, 54, 61}, {233, 56, 59},  {234, 59, 56},  {235, 62, 54},  {236, 65, 52},
     {237, 68, 50}, {238, 71, 48}, {238, 74, 45},  {239, 77, 43},  {240, 80, 41},  {240, 83, 39},  {240, 86, 37},  {241, 89, 35},  {241, 93, 33}, {241, 96, 31}, {241, 99, 29}, {241, 103, 27}, {241, 106, 26}, {240, 110, 24}, {240, 113, 22},
     {240, 117, 21}}};

const std::array<std::array<unsigned char, 3>, 256> phase_bytes = {
    {{168, 120, 13},  {169, 119, 15},  {171, 118, 17},  {172, 117, 19},  {174, 116, 20},  {175, 115, 22},  {177, 114, 24},  {178, 113, 25},  {179, 112, 27},  {181, 111, 29},  {182, 110, 30},  {183, 109, 32},  {185, 108, 34},  {186, 107, 35},
     {187, 106, 37},  {189, 105, 38},  {190, 104, 40},  {191, 103, 42},  {192, 102, 43},  {193, 101, 45},  {194, 100, 46},  {196, 98, 48},   {197, 97, 50},   {198, 96, 51},   {199, 95, 53},   {200, 94, 55},   {201, 93, 56},   {202, 92, 58},
     {203, 90, 60},   {204, 89, 62},   {205, 88, 63},   {206, 87, 65},   {207, 86, 67},   {208, 84, 69},   {208, 83, 71},   {209, 82, 73},   {210, 81, 75},   {211, 79, 77},   {212, 78, 79},   {213, 77, 81},   {213, 75, 83},   {214, 74, 85},
     {215, 73, 87},   {216, 71, 90},   {216, 70, 92},   {217, 69, 94},   {217, 67, 97},   {218, 66, 99},   {219, 64, 102},  {219, 63, 104},  {220, 61, 107},  {220, 60, 109},  {221, 58, 112},  {221, 57, 115},  {221, 56, 118},  {222, 54, 120},
     {222, 53, 123},  {222, 51, 126},  {222, 50, 129},  {223, 49, 132},  {223, 47, 135},  {223, 46, 138},  {223, 45, 141},  {223, 43, 144},  {223, 42, 147},  {222, 41, 151},  {222, 40, 154},  {222, 40, 157},  {222, 39, 160},  {221, 38, 163},
     {221, 38, 166},  {220, 37, 169},  {220, 37, 173},  {219, 37, 176},  {218, 37, 179},  {218, 38, 182},  {217, 38, 185},  {216, 39, 188},  {215, 39, 190},  {214, 40, 193},  {213, 41, 196},  {212, 42, 199},  {211, 43, 201},  {210, 45, 204},
     {209, 46, 206},  {208, 47, 208},  {207, 49, 211},  {205, 50, 213},  {204, 52, 215},  {203, 53, 217},  {201, 55, 219},  {200, 57, 221},  {198, 58, 223},  {197, 60, 225},  {195, 62, 226},  {194, 63, 228},  {192, 65, 229},  {190, 67, 231},
     {189, 69, 232},  {187, 70, 233},  {185, 72, 235},  {184, 74, 236},  {182, 75, 237},  {180, 77, 238},  {178, 79, 239},  {176, 80, 239},  {174, 82, 240},  {172, 84, 241},  {170, 85, 241},  {169, 87, 242},  {167, 89, 243},  {164, 90, 243},
     {162, 92, 243},  {160, 93, 244},  {158, 95, 244},  {156, 96, 244},  {154, 98, 244},  {152, 99, 244},  {149, 101, 244}, {147, 102, 244}, {145, 104, 244}, {143, 105, 244}, {140, 107, 243}, {138, 108, 243}, {135, 109, 243}, {133, 111, 242},
     {130, 112, 241}, {128, 113, 241}, {125, 115, 240}, {123, 116, 239}, {120, 117, 239}, {118, 119, 238}, {115, 120, 237}, {112, 121, 236}, {110, 122, 235}, {107, 123, 233}, {104, 124, 232}, {102, 126, 231}, {99, 127, 230},  {96, 128, 228},
     {93, 129, 227},  {90, 130, 225},  {88, 131, 223},  {85, 132, 222},  {82, 133, 220},  {79, 134, 218},  {77, 135, 216},  {74, 135, 215},  {71, 136, 213},  {69, 137, 211},  {66, 138, 209},  {64, 138, 207},  {61, 139, 205},  {59, 140, 203},
     {56, 140, 201},  {54, 141, 199},  {52, 142, 196},  {50, 142, 194},  {48, 143, 192},  {46, 143, 190},  {44, 144, 188},  {42, 144, 186},  {40, 145, 184},  {39, 145, 182},  {37, 145, 180},  {36, 146, 178},  {35, 146, 176},  {33, 146, 174},
     {32, 147, 172},  {31, 147, 170},  {30, 147, 168},  {29, 148, 166},  {28, 148, 164},  {27, 148, 162},  {26, 148, 160},  {25, 149, 158},  {25, 149, 156},  {24, 149, 154},  {23, 149, 152},  {22, 150, 150},  {21, 150, 148},  {20, 150, 146},
     {20, 150, 144},  {19, 151, 142},  {18, 151, 140},  {17, 151, 138},  {16, 151, 136},  {15, 151, 134},  {14, 152, 132},  {13, 152, 130},  {13, 152, 128},  {12, 152, 126},  {12, 152, 124},  {11, 153, 121},  {11, 153, 119},  {11, 153, 117},
     {12, 153, 115},  {13, 153, 112},  {14, 153, 110},  {15, 154, 107},  {17, 154, 105},  {19, 154, 102},  {21, 154, 99},   {23, 154, 97},   {25, 154, 94},   {28, 154, 91},   {31, 154, 88},   {33, 154, 85},   {36, 154, 82},   {39, 154, 79},
     {43, 154, 76},   {46, 154, 73},   {49, 153, 70},   {53, 153, 67},   {56, 153, 64},   {60, 153, 60},   {64, 152, 57},   {67, 152, 54},   {71, 151, 50},   {75, 151, 47},   {79, 150, 44},   {83, 150, 41},   {86, 149, 38},   {90, 148, 35},
     {94, 148, 32},   {97, 147, 30},   {101, 146, 27},  {104, 145, 25},  {107, 144, 23},  {111, 144, 22},  {114, 143, 20},  {116, 142, 19},  {119, 141, 18},  {122, 140, 17},  {125, 139, 16},  {127, 139, 15},  {130, 138, 15},  {132, 137, 14},
     {134, 136, 14},  {136, 135, 14},  {139, 134, 13},  {141, 133, 13},  {143, 132, 13},  {145, 131, 13},  {147, 131, 13},  {149, 130, 13},  {151, 129, 13},  {153, 128, 13},  {155, 127, 13},  {157, 126, 13},  {159, 125, 13},  {161, 124, 13},
     {162, 123, 13},  {164, 122, 13},  {166, 121, 13},  {168, 120, 13}}};

const std::array<std::array<unsigned char, 3>, 256> vegetation_bytes = {
    {{121, 91, 19},   {134, 86, 20},   {138, 85, 19},   {138, 85, 19},   {135, 87, 21},   {135, 87, 21},   {137, 90, 10},   {140, 89, 10},   {147, 87, 17},   {148, 88, 18},   {148, 88, 18},   {149, 89, 19},   {150, 90, 20},   {151, 91, 21},
     {152, 92, 22},   {152, 92, 22},   {155, 95, 25},   {155, 95, 25},   {156, 96, 26},   {156, 96, 26},   {157, 97, 27},   {158, 98, 28},   {159, 99, 29},   {159, 99, 29},   {170, 104, 26},  {170, 104, 26},  {170, 104, 26},  {171, 105, 27},
     {172, 106, 28},  {173, 107, 29},  {174, 108, 30},  {174, 108, 30},  {180, 114, 36},  {181, 115, 37},  {182, 116, 38},  {184, 118, 40},  {186, 120, 42},  {187, 121, 43},  {189, 123, 45},  {189, 123, 45},  {187, 130, 49},  {187, 130, 49},
     {189, 132, 51},  {191, 134, 53},  {194, 135, 55},  {195, 136, 56},  {197, 138, 58},  {197, 138, 58},  {195, 138, 59},  {196, 139, 60},  {196, 141, 61},  {198, 143, 63},  {196, 145, 64},  {198, 147, 66},  {197, 149, 67},  {198, 149, 72},
     {200, 158, 82},  {201, 159, 83},  {201, 162, 85},  {202, 163, 86},  {205, 166, 91},  {207, 168, 93},  {207, 169, 94},  {208, 170, 95},  {213, 175, 102}, {214, 176, 103}, {215, 178, 107}, {216, 179, 108}, {217, 183, 111}, {219, 185, 113},
     {220, 186, 114}, {221, 187, 115}, {220, 190, 120}, {221, 191, 121}, {222, 192, 122}, {224, 194, 124}, {225, 196, 126}, {227, 198, 132}, {228, 199, 133}, {229, 199, 137}, {230, 202, 137}, {231, 202, 142}, {230, 204, 143}, {231, 204, 148},
     {233, 206, 150}, {234, 207, 151}, {235, 208, 152}, {236, 209, 153}, {234, 217, 165}, {235, 217, 169}, {235, 219, 170}, {237, 221, 172}, {238, 221, 175}, {240, 223, 177}, {239, 225, 178}, {240, 225, 182}, {236, 223, 179}, {236, 222, 183},
     {238, 224, 185}, {239, 225, 186}, {240, 228, 190}, {242, 230, 192}, {243, 231, 193}, {244, 232, 194}, {240, 234, 208}, {240, 234, 212}, {241, 235, 213}, {241, 235, 213}, {241, 235, 213}, {242, 236, 214}, {241, 236, 214}, {241, 236, 217},
     {240, 237, 218}, {241, 238, 223}, {240, 238, 223}, {240, 238, 223}, {241, 239, 224}, {241, 239, 224}, {241, 239, 224}, {241, 239, 227}, {241, 241, 233}, {241, 240, 236}, {242, 241, 237}, {242, 241, 237}, {242, 243, 238}, {242, 243, 238},
     {242, 244, 241}, {242, 244, 241}, {241, 243, 242}, {241, 243, 242}, {238, 242, 241}, {238, 242, 241}, {237, 241, 242}, {236, 240, 241}, {235, 241, 241}, {235, 241, 241}, {229, 238, 237}, {229, 238, 237}, {228, 237, 236}, {228, 237, 236},
     {226, 236, 237}, {226, 236, 237}, {224, 236, 236}, {224, 236, 236}, {217, 231, 231}, {217, 231, 231}, {215, 231, 231}, {215, 231, 231}, {212, 230, 230}, {211, 229, 229}, {211, 229, 229}, {211, 229, 229}, {195, 238, 229}, {195, 238, 229},
     {194, 237, 228}, {192, 235, 226}, {189, 235, 225}, {187, 233, 223}, {183, 233, 222}, {183, 233, 222}, {176, 228, 216}, {175, 227, 215}, {173, 227, 214}, {171, 225, 212}, {168, 224, 211}, {166, 222, 209}, {164, 222, 208}, {163, 221, 207},
     {155, 221, 207}, {154, 220, 206}, {151, 219, 204}, {148, 216, 201}, {146, 214, 199}, {143, 211, 196}, {139, 210, 194}, {138, 209, 193}, {139, 212, 195}, {138, 211, 194}, {137, 210, 193}, {135, 208, 191}, {132, 206, 189}, {130, 204, 187},
     {129, 203, 186}, {128, 202, 185}, {116, 199, 181}, {116, 199, 181}, {113, 198, 179}, {111, 196, 177}, {109, 194, 175}, {107, 192, 173}, {104, 191, 172}, {103, 190, 171}, {96, 183, 166},  {95, 182, 165},  {92, 181, 163},  {91, 180, 162},
     {87, 178, 160},  {85, 176, 158},  {83, 174, 156},  {83, 174, 156},  {82, 169, 160},  {81, 168, 159},  {79, 166, 157},  {78, 165, 156},  {74, 164, 154},  {72, 162, 152},  {71, 161, 151},  {70, 160, 150},  {62, 154, 143},  {61, 153, 142},
     {59, 152, 141},  {57, 150, 139},  {55, 148, 137},  {54, 147, 136},  {53, 146, 135},  {52, 145, 134},  {44, 145, 131},  {44, 145, 131},  {42, 143, 129},  {41, 142, 128},  {39, 140, 126},  {37, 138, 124},  {36, 137, 123},  {35, 136, 122},
     {31, 132, 118},  {31, 132, 118},  {30, 131, 117},  {29, 130, 116},  {28, 129, 115},  {28, 129, 115},  {27, 128, 114},  {27, 128, 114},  {25, 125, 113},  {24, 124, 112},  {23, 123, 111},  {22, 122, 110},  {20, 120, 108},  {19, 119, 107},
     {18, 118, 106},  {17, 117, 105},  {15, 115, 103},  {15, 115, 103},  {15, 115, 103},  {14, 114, 102},  {13, 113, 101},  {13, 113, 101},  {12, 112, 100},  {12, 112, 100},  {6, 107, 91},    {6, 107, 91},    {6, 107, 89},    {8, 105, 88},
     {11, 102, 85},   {11, 102, 85},   {5, 105, 81},    {5, 105, 81}}};

const std::array<std::array<unsigned char, 3>, 256> curl_bytes = {
    {{21, 29, 68},    {21, 31, 69},    {22, 33, 70},    {22, 35, 71},    {23, 37, 72},    {23, 39, 73},    {24, 41, 74},    {24, 43, 75},    {24, 45, 76},    {25, 47, 77},    {25, 49, 79},    {26, 51, 80},    {26, 53, 81},    {26, 54, 82},
     {27, 56, 83},    {27, 58, 84},    {27, 60, 86},    {27, 62, 87},    {28, 64, 88},    {28, 66, 89},    {28, 67, 90},    {28, 69, 91},    {28, 71, 93},    {28, 73, 94},    {28, 75, 95},    {28, 76, 96},    {28, 78, 97},    {28, 80, 98},
     {28, 82, 99},    {28, 84, 101},   {27, 86, 102},   {27, 88, 103},   {27, 89, 104},   {26, 91, 105},   {26, 93, 106},   {26, 95, 107},   {25, 97, 108},   {25, 99, 109},   {24, 101, 110},  {23, 102, 111},  {23, 104, 112},  {22, 106, 113},
     {21, 108, 114},  {20, 110, 115},  {20, 112, 116},  {19, 114, 117},  {18, 116, 118},  {18, 118, 118},  {17, 119, 119},  {17, 121, 120},  {17, 123, 121},  {17, 125, 121},  {17, 127, 122},  {18, 129, 123},  {19, 131, 123},  {20, 132, 124},
     {22, 134, 124},  {23, 136, 125},  {26, 138, 125},  {28, 140, 126},  {31, 141, 126},  {34, 143, 126},  {37, 145, 127},  {41, 147, 127},  {44, 148, 127},  {48, 150, 128},  {52, 152, 128},  {56, 153, 129},  {59, 155, 129},  {63, 156, 129},
     {67, 158, 130},  {71, 159, 130},  {75, 161, 131},  {80, 162, 132},  {84, 164, 132},  {87, 165, 133},  {91, 166, 134},  {95, 168, 135},  {99, 169, 136},  {103, 171, 137}, {107, 172, 138}, {111, 173, 139}, {114, 175, 140}, {118, 176, 141},
     {122, 177, 142}, {125, 179, 144}, {129, 180, 145}, {133, 181, 147}, {136, 183, 148}, {139, 184, 150}, {143, 186, 151}, {146, 187, 153}, {150, 188, 155}, {153, 190, 157}, {156, 191, 159}, {160, 192, 160}, {163, 194, 162}, {166, 195, 164},
     {169, 197, 166}, {172, 198, 169}, {176, 200, 171}, {179, 201, 173}, {182, 203, 175}, {185, 204, 178}, {188, 206, 180}, {191, 207, 182}, {194, 209, 185}, {197, 210, 187}, {200, 212, 190}, {203, 213, 192}, {206, 215, 195}, {209, 216, 197},
     {211, 218, 200}, {214, 220, 203}, {217, 221, 205}, {220, 223, 208}, {223, 225, 211}, {226, 226, 214}, {228, 228, 216}, {231, 230, 219}, {234, 232, 222}, {237, 234, 225}, {240, 235, 228}, {242, 237, 231}, {245, 239, 234}, {248, 241, 237},
     {251, 243, 240}, {253, 245, 243}, {254, 246, 245}, {252, 244, 241}, {251, 241, 238}, {250, 239, 235}, {249, 236, 231}, {248, 234, 228}, {246, 231, 225}, {245, 229, 221}, {244, 226, 218}, {243, 224, 214}, {242, 221, 211}, {242, 219, 208},
     {241, 216, 204}, {240, 214, 201}, {239, 211, 198}, {238, 209, 195}, {237, 207, 191}, {236, 204, 188}, {236, 202, 185}, {235, 199, 182}, {234, 197, 179}, {233, 194, 175}, {233, 192, 172}, {232, 189, 169}, {231, 187, 166}, {231, 184, 163},
     {230, 182, 160}, {229, 179, 157}, {229, 177, 154}, {228, 174, 152}, {227, 172, 149}, {227, 169, 146}, {226, 167, 143}, {225, 164, 141}, {225, 162, 138}, {224, 159, 136}, {224, 157, 133}, {223, 154, 131}, {222, 152, 128}, {222, 149, 126},
     {221, 147, 124}, {220, 144, 122}, {219, 142, 120}, {219, 139, 118}, {218, 137, 116}, {217, 134, 114}, {216, 132, 113}, {215, 129, 111}, {214, 127, 110}, {214, 124, 108}, {213, 122, 107}, {212, 119, 106}, {211, 117, 105}, {210, 114, 104},
     {208, 112, 103}, {207, 110, 102}, {206, 107, 101}, {205, 105, 100}, {204, 103, 100}, {202, 100, 99},  {201, 98, 99},   {200, 96, 98},   {198, 93, 98},   {197, 91, 97},   {195, 89, 97},   {194, 87, 97},   {192, 85, 97},   {191, 83, 96},
     {189, 81, 96},   {187, 78, 96},   {186, 76, 96},   {184, 74, 96},   {182, 72, 96},   {180, 70, 96},   {179, 68, 96},   {177, 66, 96},   {175, 65, 96},   {173, 63, 96},   {171, 61, 96},   {169, 59, 96},   {167, 57, 96},   {165, 55, 96},
     {163, 54, 96},   {161, 52, 96},   {159, 50, 96},   {157, 48, 96},   {155, 47, 96},   {153, 45, 97},   {151, 43, 97},   {149, 42, 97},   {146, 40, 97},   {144, 39, 96},   {142, 37, 96},   {140, 36, 96},   {137, 34, 96},   {135, 33, 96},
     {133, 32, 96},   {130, 31, 96},   {128, 29, 95},   {125, 28, 95},   {123, 27, 94},   {120, 26, 94},   {118, 25, 93},   {115, 25, 93},   {113, 24, 92},   {110, 23, 91},   {108, 23, 90},   {105, 22, 89},   {102, 22, 88},   {100, 21, 87},
     {97, 21, 86},    {94, 20, 85},    {92, 20, 83},    {89, 20, 82},    {87, 19, 80},    {84, 19, 78},    {81, 19, 77},    {79, 18, 75},    {76, 18, 73},    {73, 18, 71},    {71, 17, 69},    {68, 17, 67},    {66, 16, 65},    {63, 16, 63},
     {61, 15, 61},    {58, 15, 59},    {56, 14, 57},    {53, 13, 54}}};

const std::array<std::array<unsigned char, 3>, 256> cool_warm_bytes = {
    {{59, 77, 193},   {60, 79, 195},   {62, 81, 196},   {63, 83, 198},   {64, 84, 199},   {65, 86, 201},   {66, 88, 202},   {67, 90, 204},   {69, 91, 205},   {70, 93, 207},   {71, 95, 208},   {72, 96, 209},   {73, 98, 211},   {75, 100, 212},
     {76, 101, 214},  {77, 103, 215},  {78, 105, 216},  {79, 106, 217},  {80, 107, 217},  {81, 109, 219},  {83, 111, 221},  {84, 112, 222},  {84, 113, 222},  {86, 116, 224},  {88, 118, 226},  {89, 119, 227},  {90, 120, 227},  {91, 122, 229},
     {93, 124, 230},  {94, 125, 231},  {95, 126, 231},  {96, 128, 233},  {98, 131, 234},  {100, 133, 235}, {101, 134, 236}, {102, 135, 237}, {103, 136, 237}, {104, 138, 238}, {106, 140, 240}, {108, 142, 241}, {109, 143, 241}, {110, 145, 242},
     {112, 146, 243}, {113, 147, 243}, {113, 148, 244}, {115, 150, 245}, {117, 152, 246}, {119, 154, 246}, {120, 155, 247}, {121, 156, 247}, {123, 158, 248}, {123, 159, 248}, {124, 159, 249}, {126, 161, 249}, {128, 163, 250}, {129, 165, 251},
     {131, 166, 251}, {132, 167, 251}, {134, 169, 252}, {134, 169, 252}, {135, 170, 252}, {137, 172, 252}, {139, 174, 253}, {141, 175, 253}, {142, 176, 253}, {143, 178, 254}, {145, 179, 254}, {146, 180, 254}, {147, 181, 254}, {149, 182, 254},
     {150, 183, 254}, {152, 185, 254}, {153, 186, 254}, {154, 186, 254}, {154, 187, 254}, {156, 188, 254}, {158, 190, 254}, {160, 191, 254}, {161, 192, 254}, {162, 193, 254}, {164, 194, 254}, {165, 195, 254}, {167, 196, 253}, {168, 197, 253},
     {169, 198, 253}, {171, 199, 253}, {172, 200, 252}, {173, 201, 252}, {175, 201, 252}, {175, 202, 251}, {176, 202, 251}, {178, 203, 251}, {180, 205, 250}, {181, 205, 249}, {182, 206, 249}, {184, 207, 248}, {185, 208, 248}, {186, 208, 247},
     {187, 209, 247}, {189, 210, 246}, {190, 210, 245}, {191, 211, 245}, {192, 212, 244}, {194, 212, 243}, {195, 213, 243}, {196, 213, 242}, {196, 213, 242}, {198, 214, 241}, {199, 215, 240}, {201, 215, 239}, {202, 216, 238}, {203, 216, 237},
     {204, 217, 236}, {205, 217, 235}, {206, 217, 234}, {208, 218, 233}, {209, 218, 232}, {210, 218, 231}, {211, 219, 230}, {212, 219, 229}, {213, 219, 228}, {214, 219, 227}, {214, 219, 227}, {215, 219, 226}, {217, 220, 224}, {218, 220, 222},
     {219, 220, 221}, {220, 220, 220}, {221, 220, 219}, {222, 219, 217}, {223, 219, 216}, {224, 218, 214}, {225, 218, 213}, {226, 217, 212}, {227, 217, 210}, {228, 216, 209}, {229, 215, 207}, {230, 215, 206}, {231, 214, 204}, {232, 213, 203},
     {233, 213, 201}, {233, 212, 200}, {234, 211, 198}, {235, 210, 197}, {236, 210, 195}, {236, 209, 194}, {237, 208, 192}, {238, 207, 191}, {238, 206, 189}, {239, 206, 188}, {239, 205, 187}, {240, 204, 186}, {241, 203, 184}, {241, 202, 182},
     {242, 201, 180}, {242, 200, 179}, {243, 199, 177}, {243, 198, 175}, {244, 197, 174}, {244, 196, 172}, {244, 195, 171}, {245, 194, 169}, {245, 192, 168}, {245, 191, 166}, {245, 190, 165}, {246, 189, 163}, {246, 188, 161}, {246, 187, 160},
     {246, 185, 158}, {246, 184, 157}, {246, 183, 155}, {247, 182, 154}, {247, 180, 152}, {247, 179, 150}, {247, 178, 149}, {247, 177, 147}, {247, 175, 146}, {247, 174, 144}, {247, 172, 143}, {246, 171, 141}, {246, 170, 139}, {246, 168, 138},
     {246, 168, 137}, {246, 167, 136}, {246, 164, 134}, {245, 162, 132}, {245, 161, 130}, {245, 159, 129}, {245, 158, 127}, {244, 156, 125}, {244, 155, 124}, {244, 153, 122}, {243, 152, 121}, {243, 150, 119}, {242, 148, 118}, {242, 147, 116},
     {242, 145, 115}, {241, 143, 113}, {241, 142, 112}, {240, 140, 110}, {239, 138, 109}, {239, 137, 107}, {238, 135, 106}, {238, 133, 104}, {237, 132, 103}, {236, 130, 101}, {236, 128, 100}, {235, 126, 98},  {234, 124, 97},  {234, 123, 96},
     {233, 121, 94},  {232, 119, 93},  {231, 117, 91},  {230, 115, 90},  {230, 114, 89},  {229, 113, 88},  {228, 110, 86},  {227, 108, 84},  {226, 106, 83},  {225, 104, 82},  {224, 102, 80},  {223, 100, 79},  {222, 98, 77},   {221, 96, 76},
     {220, 94, 75},   {219, 92, 73},   {218, 90, 72},   {217, 88, 71},   {216, 86, 70},   {215, 83, 68},   {213, 81, 67},   {212, 79, 66},   {211, 77, 64},   {210, 75, 63},   {209, 72, 62},   {207, 70, 61},   {206, 68, 59},   {205, 66, 58},
     {204, 63, 57},   {202, 61, 56},   {201, 58, 55},   {200, 56, 53},   {198, 53, 52},   {197, 50, 51},   {196, 48, 50},   {194, 45, 49},   {193, 44, 48},   {193, 42, 48},   {191, 36, 46},   {188, 31, 44},   {187, 26, 43},   {185, 22, 42},
     {184, 17, 41},   {182, 12, 40},   {181, 8, 39},    {179, 3, 38}}};

const std::array<std::array<unsigned char, 3>, 256> winter_bytes = {
    {{0, 1, 254},   {0, 1, 254},   {0, 2, 253},   {0, 3, 253},   {0, 4, 252},   {0, 5, 252},   {0, 6, 251},   {0, 7, 251},   {0, 8, 250},   {0, 9, 250},   {0, 10, 249},  {0, 11, 249},  {0, 12, 248},  {0, 13, 248},  {0, 14, 247},  {0, 15, 247},
     {0, 16, 246},  {0, 17, 246},  {0, 17, 246},  {0, 19, 245},  {0, 20, 244},  {0, 21, 244},  {0, 21, 244},  {0, 23, 243},  {0, 24, 242},  {0, 25, 242},  {0, 25, 242},  {0, 27, 241},  {0, 28, 240},  {0, 29, 240},  {0, 29, 240},  {0, 31, 239},
     {0, 32, 238},  {0, 33, 238},  {0, 34, 237},  {0, 35, 237},  {0, 35, 237},  {0, 37, 236},  {0, 38, 235},  {0, 39, 235},  {0, 40, 234},  {0, 41, 234},  {0, 42, 233},  {0, 43, 233},  {0, 43, 233},  {0, 45, 232},  {0, 46, 231},  {0, 47, 231},
     {0, 48, 230},  {0, 49, 230},  {0, 50, 229},  {0, 51, 229},  {0, 51, 229},  {0, 53, 228},  {0, 54, 227},  {0, 55, 227},  {0, 56, 226},  {0, 57, 226},  {0, 58, 225},  {0, 59, 225},  {0, 59, 225},  {0, 61, 224},  {0, 62, 223},  {0, 63, 223},
     {0, 64, 222},  {0, 65, 222},  {0, 66, 221},  {0, 67, 221},  {0, 68, 220},  {0, 69, 220},  {0, 70, 219},  {0, 71, 219},  {0, 72, 218},  {0, 73, 218},  {0, 73, 218},  {0, 75, 217},  {0, 76, 216},  {0, 77, 216},  {0, 78, 215},  {0, 79, 215},
     {0, 80, 214},  {0, 81, 214},  {0, 82, 213},  {0, 83, 213},  {0, 84, 212},  {0, 85, 212},  {0, 86, 211},  {0, 87, 211},  {0, 88, 210},  {0, 89, 210},  {0, 89, 210},  {0, 90, 209},  {0, 92, 208},  {0, 93, 208},  {0, 94, 207},  {0, 95, 207},
     {0, 96, 206},  {0, 97, 206},  {0, 98, 205},  {0, 99, 205},  {0, 100, 204}, {0, 101, 204}, {0, 102, 203}, {0, 103, 203}, {0, 104, 202}, {0, 105, 202}, {0, 105, 202}, {0, 106, 201}, {0, 108, 200}, {0, 109, 200}, {0, 110, 199}, {0, 111, 199},
     {0, 112, 198}, {0, 113, 198}, {0, 114, 197}, {0, 115, 197}, {0, 116, 196}, {0, 117, 196}, {0, 118, 195}, {0, 119, 195}, {0, 120, 194}, {0, 121, 194}, {0, 121, 194}, {0, 122, 193}, {0, 124, 192}, {0, 125, 192}, {0, 126, 191}, {0, 127, 191},
     {0, 128, 190}, {0, 129, 190}, {0, 130, 189}, {0, 131, 189}, {0, 132, 188}, {0, 133, 188}, {0, 134, 187}, {0, 135, 187}, {0, 136, 186}, {0, 137, 186}, {0, 138, 185}, {0, 139, 185}, {0, 140, 184}, {0, 141, 184}, {0, 142, 183}, {0, 143, 183},
     {0, 144, 182}, {0, 145, 182}, {0, 146, 181}, {0, 147, 181}, {0, 148, 180}, {0, 149, 180}, {0, 149, 180}, {0, 150, 179}, {0, 152, 178}, {0, 153, 178}, {0, 154, 177}, {0, 155, 177}, {0, 156, 176}, {0, 157, 176}, {0, 158, 175}, {0, 159, 175},
     {0, 160, 174}, {0, 161, 174}, {0, 162, 173}, {0, 163, 173}, {0, 164, 172}, {0, 165, 172}, {0, 166, 171}, {0, 167, 171}, {0, 168, 170}, {0, 169, 170}, {0, 170, 169}, {0, 171, 169}, {0, 172, 168}, {0, 173, 168}, {0, 174, 167}, {0, 175, 167},
     {0, 176, 166}, {0, 177, 166}, {0, 178, 165}, {0, 179, 165}, {0, 180, 164}, {0, 181, 164}, {0, 181, 164}, {0, 182, 163}, {0, 183, 163}, {0, 185, 162}, {0, 186, 161}, {0, 187, 161}, {0, 188, 160}, {0, 189, 160}, {0, 190, 159}, {0, 191, 159},
     {0, 192, 158}, {0, 193, 158}, {0, 194, 157}, {0, 195, 157}, {0, 196, 156}, {0, 197, 156}, {0, 198, 155}, {0, 199, 155}, {0, 200, 154}, {0, 201, 154}, {0, 202, 153}, {0, 203, 153}, {0, 204, 152}, {0, 205, 152}, {0, 206, 151}, {0, 207, 151},
     {0, 208, 150}, {0, 209, 150}, {0, 210, 149}, {0, 211, 149}, {0, 212, 148}, {0, 213, 148}, {0, 213, 148}, {0, 214, 147}, {0, 215, 147}, {0, 217, 146}, {0, 218, 145}, {0, 219, 145}, {0, 220, 144}, {0, 221, 144}, {0, 222, 143}, {0, 223, 143},
     {0, 224, 142}, {0, 225, 142}, {0, 226, 141}, {0, 227, 141}, {0, 228, 140}, {0, 229, 140}, {0, 230, 139}, {0, 231, 139}, {0, 232, 138}, {0, 233, 138}, {0, 234, 137}, {0, 235, 137}, {0, 236, 136}, {0, 237, 136}, {0, 238, 135}, {0, 239, 135},
     {0, 240, 134}, {0, 241, 134}, {0, 242, 133}, {0, 243, 133}, {0, 244, 132}, {0, 245, 132}, {0, 245, 132}, {0, 246, 131}, {0, 247, 131}, {0, 249, 130}, {0, 250, 129}, {0, 251, 129}, {0, 252, 128}, {0, 253, 128}, {0, 254, 127}, {0, 255, 127}}};

const std::array<std::array<unsigned char, 3>, 256> spring_bytes = {
    {{255, 1, 253},   {255, 1, 253},   {255, 2, 252},   {255, 3, 251},   {255, 4, 250},   {255, 5, 249},   {255, 6, 248},   {255, 7, 247},   {255, 8, 246},   {255, 9, 245},   {255, 10, 244},  {255, 11, 243},  {255, 12, 242},  {255, 13, 241},
     {255, 14, 240},  {255, 15, 239},  {255, 16, 238},  {255, 17, 237},  {255, 17, 237},  {255, 19, 235},  {255, 20, 234},  {255, 21, 233},  {255, 21, 233},  {255, 23, 231},  {255, 24, 230},  {255, 25, 229},  {255, 25, 229},  {255, 27, 227},
     {255, 28, 226},  {255, 29, 225},  {255, 29, 225},  {255, 31, 223},  {255, 32, 222},  {255, 33, 221},  {255, 34, 220},  {255, 35, 219},  {255, 35, 219},  {255, 37, 217},  {255, 38, 216},  {255, 39, 215},  {255, 40, 214},  {255, 41, 213},
     {255, 42, 212},  {255, 43, 211},  {255, 43, 211},  {255, 45, 209},  {255, 46, 208},  {255, 47, 207},  {255, 48, 206},  {255, 49, 205},  {255, 50, 204},  {255, 51, 203},  {255, 51, 203},  {255, 53, 201},  {255, 54, 200},  {255, 55, 199},
     {255, 56, 198},  {255, 57, 197},  {255, 58, 196},  {255, 59, 195},  {255, 59, 195},  {255, 61, 193},  {255, 62, 192},  {255, 63, 191},  {255, 64, 190},  {255, 65, 189},  {255, 66, 188},  {255, 67, 187},  {255, 68, 186},  {255, 69, 185},
     {255, 70, 184},  {255, 71, 183},  {255, 72, 182},  {255, 73, 181},  {255, 73, 181},  {255, 75, 179},  {255, 76, 178},  {255, 77, 177},  {255, 78, 176},  {255, 79, 175},  {255, 80, 174},  {255, 81, 173},  {255, 82, 172},  {255, 83, 171},
     {255, 84, 170},  {255, 85, 169},  {255, 86, 168},  {255, 87, 167},  {255, 88, 166},  {255, 89, 165},  {255, 89, 165},  {255, 90, 164},  {255, 92, 162},  {255, 93, 161},  {255, 94, 160},  {255, 95, 159},  {255, 96, 158},  {255, 97, 157},
     {255, 98, 156},  {255, 99, 155},  {255, 100, 154}, {255, 101, 153}, {255, 102, 152}, {255, 103, 151}, {255, 104, 150}, {255, 105, 149}, {255, 105, 149}, {255, 106, 148}, {255, 108, 146}, {255, 109, 145}, {255, 110, 144}, {255, 111, 143},
     {255, 112, 142}, {255, 113, 141}, {255, 114, 140}, {255, 115, 139}, {255, 116, 138}, {255, 117, 137}, {255, 118, 136}, {255, 119, 135}, {255, 120, 134}, {255, 121, 133}, {255, 121, 133}, {255, 122, 132}, {255, 124, 130}, {255, 125, 129},
     {255, 126, 128}, {255, 127, 127}, {255, 128, 126}, {255, 129, 125}, {255, 130, 124}, {255, 131, 123}, {255, 132, 122}, {255, 133, 121}, {255, 134, 120}, {255, 135, 119}, {255, 136, 118}, {255, 137, 117}, {255, 138, 116}, {255, 139, 115},
     {255, 140, 114}, {255, 141, 113}, {255, 142, 112}, {255, 143, 111}, {255, 144, 110}, {255, 145, 109}, {255, 146, 108}, {255, 147, 107}, {255, 148, 106}, {255, 149, 105}, {255, 149, 105}, {255, 150, 104}, {255, 152, 102}, {255, 153, 101},
     {255, 154, 100}, {255, 155, 99},  {255, 156, 98},  {255, 157, 97},  {255, 158, 96},  {255, 159, 95},  {255, 160, 94},  {255, 161, 93},  {255, 162, 92},  {255, 163, 91},  {255, 164, 90},  {255, 165, 89},  {255, 166, 88},  {255, 167, 87},
     {255, 168, 86},  {255, 169, 85},  {255, 170, 84},  {255, 171, 83},  {255, 172, 82},  {255, 173, 81},  {255, 174, 80},  {255, 175, 79},  {255, 176, 78},  {255, 177, 77},  {255, 178, 76},  {255, 179, 75},  {255, 180, 74},  {255, 181, 73},
     {255, 181, 73},  {255, 182, 72},  {255, 183, 71},  {255, 185, 69},  {255, 186, 68},  {255, 187, 67},  {255, 188, 66},  {255, 189, 65},  {255, 190, 64},  {255, 191, 63},  {255, 192, 62},  {255, 193, 61},  {255, 194, 60},  {255, 195, 59},
     {255, 196, 58},  {255, 197, 57},  {255, 198, 56},  {255, 199, 55},  {255, 200, 54},  {255, 201, 53},  {255, 202, 52},  {255, 203, 51},  {255, 204, 50},  {255, 205, 49},  {255, 206, 48},  {255, 207, 47},  {255, 208, 46},  {255, 209, 45},
     {255, 210, 44},  {255, 211, 43},  {255, 212, 42},  {255, 213, 41},  {255, 213, 41},  {255, 214, 40},  {255, 215, 39},  {255, 217, 37},  {255, 218, 36},  {255, 219, 35},  {255, 220, 34},  {255, 221, 33},  {255, 222, 32},  {255, 223, 31},
     {255, 224, 30},  {255, 225, 29},  {255, 226, 28},  {255, 227, 27},  {255, 228, 26},  {255, 229, 25},  {255, 230, 24},  {255, 231, 23},  {255, 232, 22},  {255, 233, 21},  {255, 234, 20},  {255, 235, 19},  {255, 236, 18},  {255, 237, 17},
     {255, 238, 16},  {255, 239, 15},  {255, 240, 14},  {255, 241, 13},  {255, 242, 12},  {255, 243, 11},  {255, 244, 10},  {255, 245, 9},   {255, 245, 9},   {255, 246, 8},   {255, 247, 7},   {255, 249, 5},   {255, 250, 4},   {255, 251, 3},
     {255, 252, 2},   {255, 253, 1},   {255, 254, 0},   {255, 255, 0}}};

const std::array<std::array<unsigned char, 3>, 256> colormap_tables[] = {turbo_bytes,    jet_bytes,    cividis_bytes, ocean_bytes,  spring_bytes, summer_bytes, autumn_bytes,     winter_bytes, geen_yellow_bytes,
                                                                         blue_red_bytes, pubugn_bytes, turbid_bytes,  pastel_bytes, helix_bytes,  phase_bytes,  vegetation_bytes, curl_bytes,   cool_warm_bytes};

std::vector<const char*> colormap_names() {
  std::vector<const char*> names = {"TURBO", "JET", "CIVIDIS", "OCEAN", "SPRING", "SUMMER", "AUTUMN", "WINTER", "GREAN_YELLOW", "BLUE_RED", "PUBUGN", "TURBID", "PASTEL", "HELIX", "PHASE", "VEGETATION", "CURL", "COOL_WARM"};
  return names;
}

std::array<std::array<unsigned char, 3>, 256> colormap_table(COLORMAP type) {
  return colormap_tables[static_cast<int>(type)];
}

Eigen::Vector4i colormap(COLORMAP type, int x) {
  x = std::max(0, std::min(255, x));
  const auto& colormap_table = colormap_tables[static_cast<int>(type)];
  return Eigen::Vector4i(colormap_table[x][0], colormap_table[x][1], colormap_table[x][2], 255);
}

Eigen::Vector4f colormapf(COLORMAP type, float x_) {
  int x = std::max<int>(0, std::min<int>(255, x_ * 255));
  return colormap(type, x).cast<float>() / 255.0f;
}

Eigen::Vector4i colormap_categorical(COLORMAP type, int x_, int num_categories) {
  x_ = x_ % num_categories;
  int step = 256 / num_categories;
  int x = x_ * step + step / 2;

  return colormap(type, x);
}

Eigen::Vector4f colormap_categoricalf(COLORMAP type, int x_, int num_categories) {
  x_ = x_ % num_categories;
  int step = 256 / num_categories;
  int x = x_ * step + step / 2;
  return colormapf(type, x / 255.0f);
}

}  // namespace glk